From 1f3f681fa70a04b80a87011a24cb6e2b827ab231 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 29 Jun 2018 13:43:15 +1000 Subject: fallback: cancel the debounce timers during device remove, not destroy destroy isn't called until the last libinput_device_unref(), so we may trigger a debounce timer after the device was removed. The same fix is neded for the touchpad interface. Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/72 Signed-off-by: Peter Hutterer --- src/evdev-fallback.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/evdev-fallback.c') diff --git a/src/evdev-fallback.c b/src/evdev-fallback.c index 7dad0fce..22dfb1b6 100644 --- a/src/evdev-fallback.c +++ b/src/evdev-fallback.c @@ -1012,6 +1012,9 @@ fallback_interface_remove(struct evdev_dispatch *evdev_dispatch) struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch); struct evdev_paired_keyboard *kbd, *tmp; + libinput_timer_cancel(&dispatch->debounce.timer); + libinput_timer_cancel(&dispatch->debounce.timer_short); + libinput_device_remove_event_listener(&dispatch->tablet_mode.other.listener); list_for_each_safe(kbd, @@ -1081,10 +1084,9 @@ fallback_interface_destroy(struct evdev_dispatch *evdev_dispatch) { struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch); - libinput_timer_cancel(&dispatch->debounce.timer); libinput_timer_destroy(&dispatch->debounce.timer); - libinput_timer_cancel(&dispatch->debounce.timer_short); libinput_timer_destroy(&dispatch->debounce.timer_short); + free(dispatch->mt.slots); free(dispatch); } -- cgit v1.2.1