From e3ee2cd9c7e9abe6614dded927787f8138f739f4 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Wed, 1 Nov 2017 19:35:39 +0100 Subject: rootston exit: fix libinput destroy The wlr_list -> wl_list rework changed 'wlr_devices' to wl_list, but missed its use on destroy. --- backend/libinput/backend.c | 7 +++---- backend/libinput/events.c | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backend/libinput') 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); } -- cgit v1.2.3 From 43cd3c7aea4c8171412a6822bf2c8308ee890b5e Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Wed, 1 Nov 2017 20:14:52 +0100 Subject: Indentation fix Some space sneaked in. tabtabtab. --- backend/libinput/backend.c | 2 +- backend/wayland/output.c | 2 +- backend/wayland/registry.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backend/libinput') diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c index 7e4d5700..07c6da13 100644 --- a/backend/libinput/backend.c +++ b/backend/libinput/backend.c @@ -101,7 +101,7 @@ static void wlr_libinput_backend_destroy(struct wlr_backend *_backend) { for (size_t i = 0; i < backend->wlr_device_lists->length; i++) { 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_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); } diff --git a/backend/wayland/output.c b/backend/wayland/output.c index fd20b3e3..90f8b39a 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -223,7 +223,7 @@ static void xdg_toplevel_handle_configure(void *data, struct zxdg_toplevel_v6 *x static void xdg_toplevel_handle_close(void *data, struct zxdg_toplevel_v6 *xdg_toplevel) { struct wlr_wl_backend_output *output = data; - assert(output && output->xdg_toplevel == xdg_toplevel); + assert(output && output->xdg_toplevel == xdg_toplevel); wl_display_terminate(output->backend->local_display); } diff --git a/backend/wayland/registry.c b/backend/wayland/registry.c index d6f61aa7..0dec0ec5 100644 --- a/backend/wayland/registry.c +++ b/backend/wayland/registry.c @@ -9,11 +9,11 @@ static void xdg_shell_handle_ping(void *data, struct zxdg_shell_v6 *shell, uint32_t serial) { - zxdg_shell_v6_pong(shell, serial); + zxdg_shell_v6_pong(shell, serial); } static const struct zxdg_shell_v6_listener xdg_shell_listener = { - xdg_shell_handle_ping, + xdg_shell_handle_ping, }; -- cgit v1.2.3 From b53db8c39e33c340214827097e26ccacbbcb5c08 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Wed, 1 Nov 2017 21:08:59 +0100 Subject: libinput backend destroy: fix small leak --- backend/libinput/backend.c | 1 + 1 file changed, 1 insertion(+) (limited to 'backend/libinput') diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c index 07c6da13..45b4e368 100644 --- a/backend/libinput/backend.c +++ b/backend/libinput/backend.c @@ -105,6 +105,7 @@ static void wlr_libinput_backend_destroy(struct wlr_backend *_backend) { wl_signal_emit(&backend->backend.events.input_remove, wlr_dev); wlr_input_device_destroy(wlr_dev); } + free(wlr_devices); } wlr_list_free(backend->wlr_device_lists); wl_event_source_remove(backend->input_event); -- cgit v1.2.3