From 3cf9cd9c86643e435bfdd0a682fdc0e80c79a056 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 7 Jan 2014 14:54:55 +1000 Subject: [PATCH] Suspend libinput before destroying it libinput_suspend() already causes the fds to be closed, devices and seats to be removed, etc. Call it before libinput_destroy() to reduce the backend-specific code. No real functional change, the udev backend already did this anyway. Signed-off-by: Peter Hutterer --- src/libinput.c | 2 ++ src/udev-seat.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libinput.c b/src/libinput.c index 98f52edb..7d564278 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -414,6 +414,8 @@ libinput_destroy(struct libinput *libinput) if (libinput == NULL) return; + libinput_suspend(libinput); + libinput->interface_backend->destroy(libinput); while ((event = libinput_get_event(libinput))) diff --git a/src/udev-seat.c b/src/udev-seat.c index 97f8259c..610b45d3 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -305,7 +305,6 @@ udev_input_destroy(struct libinput *input) if (input == NULL) return; - udev_input_disable(input); udev_unref(udev_input->udev); free(udev_input->seat_id); }