subsurface: Avoid a crash

When finalizing a subsurface, we need to make sure it is removed
from the sibling lists in its parent, or bad things will happen.

This should crashes seen in Epiphany nightly.

Fixes: #6891
This commit is contained in:
Matthias Clasen
2024-07-29 11:53:25 -04:00
parent 06372c5f2a
commit 65f727731c

View File

@@ -29,11 +29,14 @@ gdk_subsurface_init (GdkSubsurface *self)
{
}
static void remove_subsurface (GdkSubsurface *subsurface);
static void
gdk_subsurface_finalize (GObject *object)
{
GdkSubsurface *subsurface = GDK_SUBSURFACE (object);
remove_subsurface (subsurface);
g_ptr_array_remove (subsurface->parent->subsurfaces, subsurface);
g_clear_object (&subsurface->parent);