mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-04-20 04:50:46 +02:00
test: unref the litest device *after* removing it from the path interface
Our own reference may be the last one that's still alive if the context is currently suspended (litest_suspend()). If we unref before removing it from the path interface, we access already freed memory. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 40144321b234f8cee0059cf5bada8c0845065851)
This commit is contained in:
parent
b87487f808
commit
520789925c
1 changed files with 2 additions and 1 deletions
|
|
@ -1476,8 +1476,9 @@ litest_delete_device(struct litest_device *d)
|
|||
|
||||
litest_assert_int_eq(d->skip_ev_syn, 0);
|
||||
|
||||
libinput_device_unref(d->libinput_device);
|
||||
libinput_path_remove_device(d->libinput_device);
|
||||
libinput_device_unref(d->libinput_device);
|
||||
|
||||
if (d->owns_context)
|
||||
libinput_unref(d->libinput);
|
||||
close(libevdev_get_fd(d->evdev));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue