Allow libinput_destroy() on a NULL pointer

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2013-12-24 11:00:37 +10:00 committed by Jonas Ådahl
parent c789a0fdd7
commit 4e67b6da39

View 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);