mirror of
https://github.com/brl/mutter.git
synced 2025-04-13 13:49:38 +00: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
|
static void
|
||||||
meta_wayland_pointer_client_free (MetaWaylandPointerClient *pointer_client)
|
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
|
/* 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
|
* the pointer capability on the wl_seat, we need to make sure all the
|
||||||
* resources in the pointer client instance gets removed.
|
* 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_remove (wl_resource_get_link (resource));
|
||||||
wl_list_init (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_remove (wl_resource_get_link (resource));
|
||||||
wl_list_init (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_remove (wl_resource_get_link (resource));
|
||||||
wl_list_init (wl_resource_get_link (resource));
|
wl_list_init (wl_resource_get_link (resource));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user