[gtk/matthiasc/for-master: 5/8] inspector: Properly dispose GtkInspectorListData
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 5/8] inspector: Properly dispose GtkInspectorListData
- Date: Sat, 18 Jul 2020 03:19:34 +0000 (UTC)
commit 314c8558d71aff7089ef3c474ea1e0135abec5f2
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jul 17 23:05:07 2020 -0400
inspector: Properly dispose GtkInspectorListData
gtk/inspector/list-data.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/inspector/list-data.c b/gtk/inspector/list-data.c
index c51eee1ef1..596a4dbbdd 100644
--- a/gtk/inspector/list-data.c
+++ b/gtk/inspector/list-data.c
@@ -187,13 +187,15 @@ unbind_props (GtkSignalListItemFactory *factory,
}
static void
-finalize (GObject *object)
+dispose (GObject *object)
{
GtkInspectorListData *sl = GTK_INSPECTOR_LIST_DATA (object);
+ GtkWidget *child;
- gtk_inspector_list_data_set_object (sl, NULL);
+ while ((child = gtk_widget_get_first_child (GTK_WIDGET (sl))))
+ gtk_widget_unparent (child);
- G_OBJECT_CLASS (gtk_inspector_list_data_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gtk_inspector_list_data_parent_class)->dispose (object);
}
static void
@@ -202,7 +204,7 @@ gtk_inspector_list_data_class_init (GtkInspectorListDataClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->finalize = finalize;
+ object_class->dispose = dispose;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/list-data.ui");
gtk_widget_class_bind_template_child (widget_class, GtkInspectorListData, view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]