diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-07-17 22:54:19 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-07-17 22:54:19 -0400 |
commit | af30a7fe06b94cec6564f3684bebd4b6775de1bf (patch) | |
tree | fdbee062b69408194f0376d095406ae2f57dcfdd /gtk/inspector | |
parent | 9ffd7d197043ceb8fd48bde369d9369374a6a723 (diff) | |
download | gtk+-af30a7fe06b94cec6564f3684bebd4b6775de1bf.tar.gz |
inspector: Dispose tree data properly
Another place where we were leaking children.
Diffstat (limited to 'gtk/inspector')
-rw-r--r-- | gtk/inspector/tree-data.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gtk/inspector/tree-data.c b/gtk/inspector/tree-data.c index 4c0b3b8394..fdf77a2cfd 100644 --- a/gtk/inspector/tree-data.c +++ b/gtk/inspector/tree-data.c @@ -172,10 +172,25 @@ toggle_show (GtkToggleButton *button, } static void +dispose (GObject *object) +{ + GtkInspectorTreeData *sl = GTK_INSPECTOR_TREE_DATA (object); + GtkWidget *child; + + while ((child = gtk_widget_get_first_child (GTK_WIDGET (sl)))) + gtk_widget_unparent (child); + + G_OBJECT_CLASS (gtk_inspector_tree_data_parent_class)->dispose (object); +} + +static void gtk_inspector_tree_data_class_init (GtkInspectorTreeDataClass *klass) { + GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + object_class->dispose = dispose; + gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/tree-data.ui"); gtk_widget_class_bind_template_child (widget_class, GtkInspectorTreeData, view); gtk_widget_class_bind_template_child (widget_class, GtkInspectorTreeData, object_title); |