mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
widget: Unparent widgets in dispose()
If they have a non-container parent.
This commit is contained in:
parent
ef44d05894
commit
af9d932e47
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user