stack: clear accessible parent when removing child
authorChristian Hergert <chergert@redhat.com>
Tue, 28 Feb 2023 23:05:56 +0000 (15:05 -0800)
committerChristian Hergert <chergert@redhat.com>
Tue, 28 Feb 2023 23:08:20 +0000 (15:08 -0800)
Without this, the GtkStackPage may not reach a reference count of zero
and therefore will be leaked.

Fixes #5626

gtk/gtkstack.c

index 05364388a2dc1883ada8f52cef8c98d83a87df15..05ad60504b55062d73e484503812708829866c7d 100644 (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);