[epiphany/wip/exalm/tab-fix: 1/3] tab-view: Make sure it's kept alive with HdyTabView




commit 0258e6ae5a5d618bbf41612427475d00413a9daa
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Aug 22 23:48:40 2022 +0400

    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>

 src/ephy-tab-view.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
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));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]