aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2017-11-01 19:35:39 +0100
committerDominique Martinet <asmadeus@codewreck.org>2017-11-01 19:37:35 +0100
commite3ee2cd9c7e9abe6614dded927787f8138f739f4 (patch)
treef3234f8f9ede9c1ba7a8d918b022a86a0d3c7986 /backend/libinput
parentf451ea36393e8cedf29fd9877689b33ae770a8dc (diff)
rootston exit: fix libinput destroy
The wlr_list -> wl_list rework changed 'wlr_devices' to wl_list, but missed its use on destroy.
Diffstat (limited to 'backend/libinput')
-rw-r--r--backend/libinput/backend.c7
-rw-r--r--backend/libinput/events.c1
2 files changed, 4 insertions, 4 deletions
diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c
index 781314a3..7e4d5700 100644
--- a/backend/libinput/backend.c
+++ b/backend/libinput/backend.c
@@ -99,13 +99,12 @@ 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);
}
wlr_list_free(backend->wlr_device_lists);
wl_event_source_remove(backend->input_event);
diff --git a/backend/libinput/events.c b/backend/libinput/events.c
index 053cab02..5da45c67 100644
--- a/backend/libinput/events.c
+++ b/backend/libinput/events.c
@@ -26,6 +26,7 @@ struct wlr_input_device *get_appropriate_device(
static void wlr_libinput_device_destroy(struct wlr_input_device *_dev) {
struct wlr_libinput_input_device *dev = (struct wlr_libinput_input_device *)_dev;
libinput_device_unref(dev->handle);
+ wl_list_remove(&dev->wlr_input_device.link);
free(dev);
}