Commit e49a9888 authored by Peter Hutterer's avatar Peter Hutterer

touchpad: clean up tap bits on destroy

Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 67d1943c
......@@ -607,3 +607,14 @@ tp_init_tap(struct tp_dispatch *tp)
return 0;
}
void
tp_destroy_tap(struct tp_dispatch *tp)
{
if (tp->tap.source) {
libinput_remove_source(tp->device->base.seat->libinput, tp->tap.source);
tp->tap.source = NULL;
}
if (tp->tap.timer_fd > -1)
close(tp->tap.timer_fd);
}
......@@ -690,6 +690,8 @@ tp_destroy(struct evdev_dispatch *dispatch)
struct tp_dispatch *tp =
(struct tp_dispatch*)dispatch;
tp_destroy_tap(tp);
if (tp->filter)
tp->filter->interface->destroy(tp->filter);
free(tp->touches);
......@@ -760,6 +762,7 @@ tp_init(struct tp_dispatch *tp,
tp->base.interface = &tp_interface;
tp->device = device;
tp->tap.timer_fd = -1;
if (tp_init_slots(tp, device) != 0)
return -1;
......
......@@ -155,4 +155,7 @@ tp_tap_handle_timeout(struct tp_dispatch *tp, uint32_t time);
int
tp_init_tap(struct tp_dispatch *tp);
void
tp_destroy_tap(struct tp_dispatch *tp);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment