diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2017-08-11 21:02:40 +0200 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2017-08-11 21:02:40 +0200 |
commit | c42674bc2527b9c928bace0a0618723dc63b53bc (patch) | |
tree | e99e8e2f8712908043ad2369b3012328dc74af43 /backend/libinput/events.c | |
parent | ce65a0c13821279e6f090c315e7a8a331fecc35b (diff) |
Fix libinput destroy for devices with multiple capabilities
Diffstat (limited to 'backend/libinput/events.c')
-rw-r--r-- | backend/libinput/events.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/backend/libinput/events.c b/backend/libinput/events.c index 8a7971c8..0cdf26ec 100644 --- a/backend/libinput/events.c +++ b/backend/libinput/events.c @@ -24,11 +24,6 @@ struct wlr_input_device *get_appropriate_device( } static void wlr_libinput_device_destroy(struct wlr_input_device_state *state) { - list_t *devices = libinput_device_get_user_data(state->handle); - // devices themselves are freed in wlr_libinput_backend_destroy - // this list only has a part of the same elements so just free list - list_free(devices); - libinput_device_unref(state->handle); free(state); } @@ -51,7 +46,6 @@ static struct wlr_input_device *allocate_device( type, &input_device_impl, devstate, name, vendor, product); list_add(devices, wlr_device); - list_add(state->devices, wlr_device); return wlr_device; } @@ -109,6 +103,7 @@ static void handle_device_added(struct wlr_backend_state *state, if (devices->length > 0) { libinput_device_set_user_data(device, devices); + list_add(state->devices, devices); } else { list_free(devices); } |