[mutter] wayland: Use wl_resource_for_each_safe() on pointer client destruction



commit 804ab7894f69fa670d16e81f81d5eb7a9a817280
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Aug 14 14:46:27 2015 +0200

    wayland: Use wl_resource_for_each_safe() on pointer client destruction
    
    We must use this by definition since we're removing all elements from the
    resource lists.

 src/wayland/meta-wayland-pointer.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 0de7a61..04ba1fb 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -74,23 +74,23 @@ meta_wayland_pointer_client_new (void)
 static void
 meta_wayland_pointer_client_free (MetaWaylandPointerClient *pointer_client)
 {
-  struct wl_resource *resource;
+  struct wl_resource *resource, *next;
 
   /* Since we make every wl_pointer resource defunct when we stop advertising
    * the pointer capability on the wl_seat, we need to make sure all the
    * resources in the pointer client instance gets removed.
    */
-  wl_resource_for_each (resource, &pointer_client->pointer_resources)
+  wl_resource_for_each_safe (resource, next, &pointer_client->pointer_resources)
     {
       wl_list_remove (wl_resource_get_link (resource));
       wl_list_init (wl_resource_get_link (resource));
     }
-  wl_resource_for_each (resource, &pointer_client->swipe_gesture_resources)
+  wl_resource_for_each_safe (resource, next, &pointer_client->swipe_gesture_resources)
     {
       wl_list_remove (wl_resource_get_link (resource));
       wl_list_init (wl_resource_get_link (resource));
     }
-  wl_resource_for_each (resource, &pointer_client->pinch_gesture_resources)
+  wl_resource_for_each_safe (resource, next, &pointer_client->pinch_gesture_resources)
     {
       wl_list_remove (wl_resource_get_link (resource));
       wl_list_init (wl_resource_get_link (resource));


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