diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-08-24 09:04:19 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-08-26 08:32:11 -0400 |
commit | 9978349903f8cc31c6dbf4a807c1f456ccecd5a4 (patch) | |
tree | 35e0546590d7af0d391cc446fbe83eb7b3ed4c2d | |
parent | e3d47376dc9a7ffef3823cb2b4db78296e3cf717 (diff) | |
download | wlroots-9978349903f8cc31c6dbf4a807c1f456ccecd5a4.tar.xz |
use safe for_each when freeing cursor devices
-rw-r--r-- | types/wlr_cursor.c | 4 |
1 files 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); } |