summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Mikhaylenko <alexm@gnome.org>2022-08-22 23:48:40 +0400
committerMarge Bot <marge-bot@gnome.org>2022-08-30 15:10:40 +0000
commit2d673b17b8343c93091f5c291224c4570da8d13a (patch)
tree2175f6352ad71204617cf98a4179dea9b442317a
parent40405aea7e688f8fd892eefa8d19b7a60a79456d (diff)
downloadepiphany-2d673b17b8343c93091f5c291224c4570da8d13a.tar.gz
tab-view: Make sure it's kept alive with HdyTabView
The latter has a way to get EphyTabView from it; if EphyTabView is disposed first, we get a use-after-free. Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1188>
-rw-r--r--src/ephy-tab-view.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ephy-tab-view.c b/src/ephy-tab-view.c
index e2c785892..d29846cbd 100644
--- a/src/ephy-tab-view.c
+++ b/src/ephy-tab-view.c
@@ -153,7 +153,8 @@ ephy_tab_view_init (EphyTabView *self)
self->tab_view = HDY_TAB_VIEW (hdy_tab_view_new ());
gtk_widget_show (GTK_WIDGET (self->tab_view));
- g_object_set_data (G_OBJECT (self->tab_view), "ephy-tab-view", self);
+ g_object_set_data_full (G_OBJECT (self->tab_view), "ephy-tab-view",
+ g_object_ref (self), g_object_unref);
gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (self->tab_view));