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
This commit is contained in:
Dominique Martinet 2017-08-21 07:58:53 +02:00
parent 9f6c8e6288
commit ee3c5c7fef

View file

@ -180,8 +180,8 @@ void wlr_seat_destroy(struct wlr_seat *wlr_seat) {
return; return;
} }
struct wlr_seat_handle *handle; struct wlr_seat_handle *handle, *tmp;
wl_list_for_each(handle, &wlr_seat->handles, link) { wl_list_for_each_safe(handle, tmp, &wlr_seat->handles, link) {
wl_resource_destroy(handle->wl_resource); // will destroy other resources as well wl_resource_destroy(handle->wl_resource); // will destroy other resources as well
} }