From c42674bc2527b9c928bace0a0618723dc63b53bc Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 11 Aug 2017 21:02:40 +0200 Subject: Fix libinput destroy for devices with multiple capabilities --- backend/libinput/backend.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'backend/libinput/backend.c') diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c index 8c1c305d..19fe8fe7 100644 --- a/backend/libinput/backend.c +++ b/backend/libinput/backend.c @@ -81,15 +81,15 @@ static void wlr_libinput_backend_destroy(struct wlr_backend_state *state) { if (!state) { return; } - for (size_t i = 0; i < state->devices->length; i++) { - struct wlr_input_device *wlr_device = state->devices->items[i]; - - wlr_input_device_destroy(wlr_device); + list_t *wlr_devices = state->devices->items[i]; + for (size_t j = 0; j < wlr_devices->length; j++) { + wlr_input_device_destroy(wlr_devices->items[j]); + } + list_free(wlr_devices); } list_free(state->devices); libinput_unref(state->libinput); - free(state); } -- cgit v1.2.3