From 9978349903f8cc31c6dbf4a807c1f456ccecd5a4 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Thu, 24 Aug 2017 09:04:19 -0400 Subject: [PATCH] use safe for_each when freeing cursor devices --- types/wlr_cursor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c index ed53fa7e..93ba3478 100644 --- a/types/wlr_cursor.c +++ b/types/wlr_cursor.c @@ -51,8 +51,8 @@ struct wlr_cursor *wlr_cursor_init() { } void wlr_cursor_destroy(struct wlr_cursor *cur) { - struct wlr_cursor_device *device; - wl_list_for_each(device, &cur->state->devices, link) { + struct wlr_cursor_device *device, *tmp = NULL; + wl_list_for_each_safe(device, tmp, &cur->state->devices, link) { wl_list_remove(&device->link); free(device); }