Allow libinput_destroy() on a NULL pointer
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 24 Dec 2013 01:00:37 +0000 (11:00 +1000)
committerJonas Ådahl <jadahl@gmail.com>
Wed, 8 Jan 2014 19:45:58 +0000 (20:45 +0100)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/libinput.c

index 550ca94..e30b6a2 100644 (file)
@@ -400,6 +400,9 @@ libinput_destroy(struct libinput *libinput)
        struct libinput_device *device, *next_device;
        struct libinput_seat *seat, *next_seat;
 
+       if (libinput == NULL)
+               return;
+
        while ((event = libinput_get_event(libinput)))
               libinput_event_destroy(event);
        free(libinput->events);