mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 21:51:08 +00:00
Merge branch 'mcatanzaro/company-unparent-warning' into 'master'
Add critical if widget has a parent during dispose See merge request GNOME/gtk!3053
This commit is contained in:
commit
2a79152762
@ -7187,7 +7187,13 @@ gtk_widget_dispose (GObject *object)
|
||||
gtk_list_list_model_clear (priv->controller_observer);
|
||||
|
||||
if (priv->parent)
|
||||
gtk_widget_unparent (widget);
|
||||
{
|
||||
g_critical ("%s %p has a parent %s %p during dispose. Parents hold a reference, so this should not happen.\n"
|
||||
"Did you call g_object_unref() instead of gtk_widget_unparent()?",
|
||||
G_OBJECT_TYPE_NAME (widget), widget,
|
||||
G_OBJECT_TYPE_NAME (priv->parent), priv->parent);
|
||||
priv->parent = NULL;
|
||||
}
|
||||
|
||||
while (priv->paintables)
|
||||
gtk_widget_paintable_set_widget (priv->paintables->data, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user