[gtk+/wip/baedert/children: 68/68] widget: Warn on destroy if not all child widgets have bee destroyed



commit 20405c9b7d1c9323b3d03e02216216bf7b0a0dca
Author: Timm Bäder <mail baedert org>
Date:   Wed Dec 7 08:56:01 2016 +0100

    widget: Warn on destroy if not all child widgets have bee destroyed

 gtk/gtkwidget.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index d5366d7..f7c440c 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10684,6 +10684,19 @@ gtk_widget_real_destroy (GtkWidget *object)
       priv->accessible = NULL;
     }
 
+  if (_gtk_widget_get_first_child (widget) != NULL)
+    {
+      GtkWidget *child;
+      g_warning ("Destroying %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);
+        }
+    }
+
   /* wipe accelerator closures (keep order) */
   g_object_set_qdata (G_OBJECT (widget), quark_accel_path, NULL);
   g_object_set_qdata (G_OBJECT (widget), quark_accel_closures, NULL);


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