summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-07-17 22:44:01 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-07-17 22:54:10 -0400
commit9ffd7d197043ceb8fd48bde369d9369374a6a723 (patch)
treedd7825e6a5ffc952cae3234f56f46f627df79f56
parentcb906c80eb584a3362f8581f3b5341d893583d00 (diff)
downloadgtk+-9ffd7d197043ceb8fd48bde369d9369374a6a723.tar.gz
inspector: Dispose the recorder properly
We were leaking children here.
-rw-r--r--gtk/inspector/recorder.c3
-rw-r--r--gtk/inspector/recorder.ui2
2 files changed, 4 insertions, 1 deletions
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index a8a536f2af..c07d63b01b 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -61,6 +61,7 @@ struct _GtkInspectorRecorder
GListStore *render_node_root_model;
GtkSingleSelection *render_node_selection;
+ GtkWidget *box;
GtkWidget *recordings_list;
GtkWidget *render_node_view;
GtkWidget *render_node_list;
@@ -1168,6 +1169,7 @@ gtk_inspector_recorder_dispose (GObject *object)
{
GtkInspectorRecorder *recorder = GTK_INSPECTOR_RECORDER (object);
+ g_clear_pointer (&recorder->box, gtk_widget_unparent);
g_clear_object (&recorder->render_node_model);
g_clear_object (&recorder->render_node_root_model);
g_clear_object (&recorder->render_node_selection);
@@ -1202,6 +1204,7 @@ gtk_inspector_recorder_class_init (GtkInspectorRecorderClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/recorder.ui");
+ gtk_widget_class_bind_template_child (widget_class, GtkInspectorRecorder, box);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorRecorder, recordings);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorRecorder, recordings_list);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorRecorder, render_node_view);
diff --git a/gtk/inspector/recorder.ui b/gtk/inspector/recorder.ui
index 100d51659b..48bc98d404 100644
--- a/gtk/inspector/recorder.ui
+++ b/gtk/inspector/recorder.ui
@@ -2,7 +2,7 @@
<object class="GListStore" id="recordings"/>
<template class="GtkInspectorRecorder" parent="GtkWidget">
<child>
- <object class="GtkBox">
+ <object class="GtkBox" id="box">
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">