aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2017-08-21 07:58:53 +0200
committerDominique Martinet <asmadeus@codewreck.org>2017-08-21 07:59:08 +0200
commitee3c5c7fef6dc223744c8e90126f3382f02b6942 (patch)
treee560f41ddf02d8d45f0810182420870c743b5b4f
parent9f6c8e6288470aeae0076d4849a17a3aca44b000 (diff)
wlr_seat: fix destroy with multiple handles
Need to use for_each_safe because wl_resource_destroy's callback will remove the handle from the list itself
-rw-r--r--types/wlr_seat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/types/wlr_seat.c b/types/wlr_seat.c
index f01f7974..2c1abd94 100644
--- a/types/wlr_seat.c
+++ b/types/wlr_seat.c
@@ -180,8 +180,8 @@ void wlr_seat_destroy(struct wlr_seat *wlr_seat) {
return;
}
- struct wlr_seat_handle *handle;
- wl_list_for_each(handle, &wlr_seat->handles, link) {
+ struct wlr_seat_handle *handle, *tmp;
+ wl_list_for_each_safe(handle, tmp, &wlr_seat->handles, link) {
wl_resource_destroy(handle->wl_resource); // will destroy other resources as well
}