input: Stop leaking libinput event source on session deactivation
This is easily noticed as a leaked fd on every VC switch. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
committed by
Pekka Paalanen
parent
6b65d8f120
commit
0e4e570cae
@@ -134,6 +134,8 @@ udev_input_disable(struct udev_input *input)
|
|||||||
if (input->suspended)
|
if (input->suspended)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
wl_event_source_remove(input->libinput_source);
|
||||||
|
input->libinput_source = NULL;
|
||||||
libinput_suspend(input->libinput);
|
libinput_suspend(input->libinput);
|
||||||
process_events(input);
|
process_events(input);
|
||||||
input->suspended = 1;
|
input->suspended = 1;
|
||||||
@@ -337,7 +339,8 @@ udev_input_destroy(struct udev_input *input)
|
|||||||
{
|
{
|
||||||
struct udev_seat *seat, *next;
|
struct udev_seat *seat, *next;
|
||||||
|
|
||||||
wl_event_source_remove(input->libinput_source);
|
if (input->libinput_source)
|
||||||
|
wl_event_source_remove(input->libinput_source);
|
||||||
wl_list_for_each_safe(seat, next, &input->compositor->seat_list, base.link)
|
wl_list_for_each_safe(seat, next, &input->compositor->seat_list, base.link)
|
||||||
udev_seat_destroy(seat);
|
udev_seat_destroy(seat);
|
||||||
libinput_unref(input->libinput);
|
libinput_unref(input->libinput);
|
||||||
|
|||||||
Reference in New Issue
Block a user