mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-04 17:50:15 +01:00
test: fix memleak in the udev_device_sysname() test
If a device sends other events at startup, those events weren't freed. This can happen on tablet devices that send proximity events immediately after DEVICE_ADDED. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6e8dc031ba
commit
cc46e00e81
1 changed files with 4 additions and 1 deletions
|
|
@ -413,8 +413,11 @@ START_TEST(udev_device_sysname)
|
|||
libinput_dispatch(li);
|
||||
|
||||
while ((ev = libinput_get_event(li))) {
|
||||
if (libinput_event_get_type(ev) != LIBINPUT_EVENT_DEVICE_ADDED)
|
||||
if (libinput_event_get_type(ev) !=
|
||||
LIBINPUT_EVENT_DEVICE_ADDED) {
|
||||
libinput_event_destroy(ev);
|
||||
continue;
|
||||
}
|
||||
|
||||
device = libinput_event_get_device(ev);
|
||||
sysname = libinput_device_get_sysname(device);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue