mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 01:10:25 +01:00
tools: list-devices: unref the udev device
Fixes a memory leak that prevents us from running list-devices in valgrind. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
7c51c881dc
commit
1605f71a0b
1 changed files with 5 additions and 2 deletions
|
|
@ -270,6 +270,7 @@ print_device_notify(struct libinput_event *ev)
|
|||
struct libinput_device *dev = libinput_event_get_device(ev);
|
||||
struct libinput_seat *seat = libinput_device_get_seat(dev);
|
||||
struct libinput_device_group *group;
|
||||
struct udev_device *udev_device;
|
||||
double w, h;
|
||||
static int next_group_id = 0;
|
||||
intptr_t group_id;
|
||||
|
|
@ -283,8 +284,8 @@ print_device_notify(struct libinput_event *ev)
|
|||
libinput_device_group_set_user_data(group, (void*)group_id);
|
||||
}
|
||||
|
||||
devnode = udev_device_get_devnode(
|
||||
libinput_device_get_udev_device(dev));
|
||||
udev_device = libinput_device_get_udev_device(dev);
|
||||
devnode = udev_device_get_devnode(udev_device);
|
||||
|
||||
printf("Device: %s\n"
|
||||
"Kernel: %s\n"
|
||||
|
|
@ -296,6 +297,8 @@ print_device_notify(struct libinput_event *ev)
|
|||
libinput_seat_get_physical_name(seat),
|
||||
libinput_seat_get_logical_name(seat));
|
||||
|
||||
udev_device_unref(udev_device);
|
||||
|
||||
if (libinput_device_get_size(dev, &w, &h) == 0)
|
||||
printf("Size: %.fx%.fmm\n", w, h);
|
||||
printf("Capabilities: ");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue