wayland: Ensure to unlink destroy listeners for subsurfaces

There is some surface tracking going on here, and all notify handlers
are possibly leaving the linked wl_listener behind. Ensure it is unlinked
in all destroy notification functions.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2588>
This commit is contained in:
Carlos Garnacho 2022-08-19 17:10:15 +02:00 committed by Marge Bot
parent 51064c1b4e
commit f4f39d3a2c

View File

@ -342,6 +342,7 @@ subsurface_handle_pending_subsurface_destroyed (struct wl_listener *listener,
wl_container_of (listener, op, subsurface_destroy_listener);
op->surface = NULL;
wl_list_remove (&op->subsurface_destroy_listener.link);
}
static void
@ -352,6 +353,7 @@ subsurface_handle_pending_sibling_destroyed (struct wl_listener *listener,
wl_container_of (listener, op, sibling_destroy_listener);
op->sibling = NULL;
wl_list_remove (&op->sibling_destroy_listener.link);
}
void
@ -487,6 +489,7 @@ surface_handle_parent_surface_destroyed (struct wl_listener *listener,
g_node_unlink (surface->subsurface_branch_node);
surface->sub.parent = NULL;
wl_list_remove (&surface->sub.parent_destroy_listener.link);
}
static gboolean