If we never initialized the libwacom database, don't check the refcount

If the libwacom context failed to initialize for some reason, the database is
NULL and the refcount remains at zero. Calling unref should just work then.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-06-26 14:15:09 +10:00
parent b12084ef76
commit 82102f8599

View file

@ -4257,6 +4257,9 @@ libinput_libwacom_ref(struct libinput *li)
void
libinput_libwacom_unref(struct libinput *li)
{
if (!li->libwacom.db)
return;
assert(li->libwacom.refcount >= 1);
if (--li->libwacom.refcount == 0) {