Suspend libinput before destroying it
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 7 Jan 2014 04:54:55 +0000 (14:54 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 10 Jan 2014 01:08:24 +0000 (11:08 +1000)
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 <peter.hutterer@who-t.net>
src/libinput.c
src/udev-seat.c

index 98f52edb02c16efa84498b4bdb2014d0dd5faf51..7d564278f297a2742a088074c461f3f3e4d5717a 100644 (file)
@@ -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)))
index 97f8259cbe7d710997c337e46b76892ef7601cb0..610b45d36d3c3f3bd1a9be1bd43b8c17cc948e24 100644 (file)
@@ -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);
 }