aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput/backend.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-11-02 23:34:02 -0400
committerDrew DeVault <sir@cmpwn.com>2017-11-02 23:34:02 -0400
commit86b87299986a430a52b4eac3f2e0e7b659176c90 (patch)
treeac8523d64c6b2faa8d7156093c8dc8f6998301b7 /backend/libinput/backend.c
parent975b9dc365d5a7bec531522320a1506323575525 (diff)
parentec11a95d0c945d138cede66b7c6e53e343c82f8f (diff)
Merge remote-tracking branch 'origin/master' into hidpi
Diffstat (limited to 'backend/libinput/backend.c')
-rw-r--r--backend/libinput/backend.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c
index 781314a3..45b4e368 100644
--- a/backend/libinput/backend.c
+++ b/backend/libinput/backend.c
@@ -99,13 +99,13 @@ static void wlr_libinput_backend_destroy(struct wlr_backend *_backend) {
}
struct wlr_libinput_backend *backend = (struct wlr_libinput_backend *)_backend;
for (size_t i = 0; i < backend->wlr_device_lists->length; i++) {
- struct wlr_list *wlr_devices = backend->wlr_device_lists->items[i];
- for (size_t j = 0; j < wlr_devices->length; j++) {
- struct wlr_input_device *wlr_dev = wlr_devices->items[j];
+ struct wl_list *wlr_devices = backend->wlr_device_lists->items[i];
+ struct wlr_input_device *wlr_dev, *next;
+ wl_list_for_each_safe(wlr_dev, next, wlr_devices, link) {
wl_signal_emit(&backend->backend.events.input_remove, wlr_dev);
wlr_input_device_destroy(wlr_dev);
}
- wlr_list_free(wlr_devices);
+ free(wlr_devices);
}
wlr_list_free(backend->wlr_device_lists);
wl_event_source_remove(backend->input_event);