[gtk+] widget: Unparent widgets in dispose()
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Unparent widgets in dispose()
- Date: Sat, 7 Jan 2017 16:20:50 +0000 (UTC)
commit af9d932e47aeb858ae91670ddae62547add2f37d
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 e481a72..1de5d2f 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10382,8 +10382,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]