mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-05 01:40:29 +01:00
Unref seats and devices in libinput_destroy()
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
parent
3bf28bfc14
commit
58a33bd51c
1 changed files with 11 additions and 0 deletions
|
|
@ -384,11 +384,22 @@ LIBINPUT_EXPORT void
|
|||
libinput_destroy(struct libinput *libinput)
|
||||
{
|
||||
struct libinput_event *event;
|
||||
struct libinput_device *device, *next_device;
|
||||
struct libinput_seat *seat, *next_seat;
|
||||
|
||||
while ((event = libinput_get_event(libinput)))
|
||||
free(event);
|
||||
free(libinput->events);
|
||||
|
||||
list_for_each_safe(seat, next_seat, &libinput->seat_list, link) {
|
||||
list_for_each_safe(device, next_device,
|
||||
&seat->devices_list,
|
||||
link)
|
||||
libinput_device_unref(device);
|
||||
|
||||
libinput_seat_unref(seat);
|
||||
}
|
||||
|
||||
close(libinput->epoll_fd);
|
||||
free(libinput);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue