mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
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.
This commit is contained in:
parent
299ed424d3
commit
804ab7894f
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user