stack: clear accessible parent when removing child

Without this, the GtkStackPage may not reach a reference count of zero
and therefore will be leaked.

Fixes #5626
This commit is contained in:
Christian Hergert 2023-02-28 15:05:56 -08:00
parent 471ebabd77
commit 40d4441fd8

View File

@ -1726,6 +1726,7 @@ stack_remove (GtkStack *stack,
if (priv->last_visible_child == child_info)
priv->last_visible_child = NULL;
gtk_accessible_set_accessible_parent (GTK_ACCESSIBLE (child), NULL, NULL);
gtk_widget_unparent (child);
g_clear_object (&child_info->widget);