-/* $OpenBSD: wsmouse.c,v 1.66 2020/07/29 05:53:52 anton Exp $ */
+/* $OpenBSD: wsmouse.c,v 1.67 2021/03/21 16:20:49 bru Exp $ */
/* $NetBSD: wsmouse.c,v 1.35 2005/02/27 00:27:52 perry Exp $ */
/*
void
wsmouse_input_cleanup(struct wsmouseinput *input)
{
+ if (input->tp != NULL)
+ wstpad_cleanup(input);
+
free_mt_slots(input);
}
-/* $OpenBSD: wsmouseinput.h,v 1.14 2019/08/19 21:19:38 bru Exp $ */
+/* $OpenBSD: wsmouseinput.h,v 1.15 2021/03/21 16:20:49 bru Exp $ */
/*
* Copyright (c) 2015, 2016 Ulf Brosziewski
void wstpad_init_deceleration(struct wsmouseinput *);
int wstpad_configure(struct wsmouseinput *);
void wstpad_reset(struct wsmouseinput *);
+void wstpad_cleanup(struct wsmouseinput *);
int wstpad_get_param(struct wsmouseinput *, int, int *);
int wstpad_set_param(struct wsmouseinput *, int, int);
-/* $OpenBSD: wstpad.c,v 1.27 2021/03/03 19:44:37 bru Exp $ */
+/* $OpenBSD: wstpad.c,v 1.28 2021/03/21 16:20:49 bru Exp $ */
/*
* Copyright (c) 2015, 2016 Ulf Brosziewski
}
}
+void
+wstpad_cleanup(struct wsmouseinput *input)
+{
+ struct wstpad *tp = input->tp;
+ int slots;
+
+ timeout_del(&tp->tap.to);
+ slots = imax(input->mt.num_slots, 1);
+ free(tp->tpad_touches, M_DEVBUF, slots * sizeof(struct tpad_touch));
+ free(tp, M_DEVBUF, sizeof(struct wstpad));
+ input->tp = NULL;
+}
+
int
wstpad_set_param(struct wsmouseinput *input, int key, int val)
{