From ee3c5c7fef6dc223744c8e90126f3382f02b6942 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Mon, 21 Aug 2017 07:58:53 +0200 Subject: 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 --- types/wlr_seat.c | 4 ++-- 1 file 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 } -- cgit v1.2.3