diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2017-08-21 07:58:53 +0200 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2017-08-21 07:59:08 +0200 |
commit | ee3c5c7fef6dc223744c8e90126f3382f02b6942 (patch) | |
tree | e560f41ddf02d8d45f0810182420870c743b5b4f | |
parent | 9f6c8e6288470aeae0076d4849a17a3aca44b000 (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.c | 4 |
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 } |