From 40d4441fd85742837d85d8509dc89355d39a1cdc Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 28 Feb 2023 15:05:56 -0800 Subject: [PATCH] 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 --- gtk/gtkstack.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index 05364388a2..05ad60504b 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -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);