[libadwaita/wip/exalm/shader-crash: 3/3] tab: Free the shader in unrealize() instead of dispose()




commit 4f495da3414bd8215add0a9fc91d54a6fcdf49f7
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Jul 20 13:25:37 2021 +0500

    tab: Free the shader in unrealize() instead of dispose()

 src/adw-tab.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/adw-tab.c b/src/adw-tab.c
index efaf5c6e..8ac15719 100644
--- a/src/adw-tab.c
+++ b/src/adw-tab.c
@@ -616,6 +616,16 @@ adw_tab_direction_changed (GtkWidget        *widget,
                                                               previous_direction);
 }
 
+static void
+adw_tab_unrealize (GtkWidget *widget)
+{
+  AdwTab *self = ADW_TAB (widget);
+
+  GTK_WIDGET_CLASS (adw_tab_parent_class)->unrealize (widget);
+
+  g_clear_object (&self->shader);
+}
+
 static void
 adw_tab_constructed (GObject *object)
 {
@@ -745,6 +755,7 @@ adw_tab_class_init (AdwTabClass *klass)
   widget_class->unmap = adw_tab_unmap;
   widget_class->snapshot = adw_tab_snapshot;
   widget_class->direction_changed = adw_tab_direction_changed;
+  widget_class->unrealize = adw_tab_unrealize;
 
   props[PROP_VIEW] =
     g_param_spec_object ("view",


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