input: remove tablet/pad signal listeners on destroy

We should remove those when destroying a tablet
or a tablet pad.

Also rename 'tablet' to 'pad' in 'tablet_pad' for better
readability and consistency.
This commit is contained in:
Jens Peters 2024-04-11 23:47:10 +02:00 committed by Johan Malm
parent b6e439a5cc
commit 163f11595f
2 changed files with 17 additions and 9 deletions

View file

@ -124,6 +124,11 @@ handle_destroy(struct wl_listener *listener, void *data)
{
struct drawing_tablet *tablet =
wl_container_of(listener, tablet, handlers.destroy);
wl_list_remove(&tablet->handlers.tip.link);
wl_list_remove(&tablet->handlers.button.link);
wl_list_remove(&tablet->handlers.axis.link);
wl_list_remove(&tablet->handlers.destroy.link);
free(tablet);
}