[gtk+/wip/baedert/children: 34/36] widget: Warn if children are left in finalize()
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/children: 34/36] widget: Warn if children are left in finalize()
- Date: Wed, 7 Dec 2016 17:28:06 +0000 (UTC)
commit 3eba9b72156834a67353f25a5db98d733a291234
Author: Timm Bäder <mail baedert org>
Date: Wed Dec 7 14:05:34 2016 +0100
widget: Warn if children are left in finalize()
gtk/gtkwidget.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index d5366d7..1599c9b 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10727,6 +10727,19 @@ gtk_widget_finalize (GObject *object)
g_list_free_full (priv->event_controllers, g_free);
priv->event_controllers = NULL;
+ if (_gtk_widget_get_first_child (widget) != NULL)
+ {
+ GtkWidget *child;
+ g_warning ("Finalizing %s %p, but it still has children left:",
+ gtk_widget_get_name (widget), widget);
+ for (child = _gtk_widget_get_first_child (widget);
+ child != NULL;
+ child = _gtk_widget_get_next_sibling (child))
+ {
+ g_warning (" - %s %p", gtk_widget_get_name (child), child);
+ }
+ }
+
if (g_object_is_floating (object))
g_warning ("A floating object was finalized. This means that someone\n"
"called g_object_unref() on an object that had only a floating\n"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]