[mutter/wip/carlosg/unlink-listeners: 27/28] wayland: Ensure to unlink destroy listeners for subsurfaces




commit f4f39d3a2cd2de35e1f85e32182a34336d52ae3d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Aug 19 17:10:15 2022 +0200

    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>

 src/wayland/meta-wayland-subsurface.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c
index 3e088b04fb..6a23c86100 100644
--- a/src/wayland/meta-wayland-subsurface.c
+++ b/src/wayland/meta-wayland-subsurface.c
@@ -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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]