From: Christian Hergert Date: Tue, 28 Feb 2023 23:05:56 +0000 (-0800) Subject: stack: clear accessible parent when removing child X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~6^2~18^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=40d4441fd85742837d85d8509dc89355d39a1cdc;p=gtk4.git 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 --- 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);