[gtk+/wip/baedert/children: 38/43] widget: Unparent widgets in dispose()



commit 984eac4bb78b4fa15e54d9811304933d5359da58
Author: Timm Bäder <mail baedert org>
Date:   Fri Nov 18 10:02:22 2016 +0100

    widget: Unparent widgets in dispose()
    
    If they have a non-container parent.

 gtk/gtkwidget.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 325794a..b18a130 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10529,8 +10529,10 @@ gtk_widget_dispose (GObject *object)
   GtkWidgetPrivate *priv = widget->priv;
   GSList *sizegroups;
 
-  if (priv->parent)
+  if (priv->parent && GTK_IS_CONTAINER (priv->parent))
     gtk_container_remove (GTK_CONTAINER (priv->parent), widget);
+  else if (priv->parent)
+    gtk_widget_unparent (widget);
   else if (_gtk_widget_get_visible (widget))
     gtk_widget_hide (widget);
 


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