From 4e67b6da3986af9d0a4920929c82422cc005b426 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 24 Dec 2013 11:00:37 +1000 Subject: [PATCH] Allow libinput_destroy() on a NULL pointer Signed-off-by: Peter Hutterer --- src/libinput.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libinput.c b/src/libinput.c index 550ca942..e30b6a29 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -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);