From 870c44bfed01542b36aaa205d34f19245bb7ad88 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Tue, 25 Sep 2018 09:20:56 +0300 Subject: [PATCH] safer this way, just in case.. --- src/joystick/hidapi/SDL_hidapijoystick.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index d238fc2981337..d37a7ca889f57 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -376,13 +376,13 @@ HIDAPI_ShutdownDiscovery() #endif #if defined(SDL_USE_LIBUDEV) - if (SDL_HIDAPI_discovery.m_pUdevMonitor) { - usyms->udev_monitor_unref(SDL_HIDAPI_discovery.m_pUdevMonitor); - } - if (SDL_HIDAPI_discovery.m_pUdev) { - usyms->udev_unref(SDL_HIDAPI_discovery.m_pUdev); - } if (usyms) { + if (SDL_HIDAPI_discovery.m_pUdevMonitor) { + usyms->udev_monitor_unref(SDL_HIDAPI_discovery.m_pUdevMonitor); + } + if (SDL_HIDAPI_discovery.m_pUdev) { + usyms->udev_unref(SDL_HIDAPI_discovery.m_pUdev); + } SDL_UDEV_ReleaseUdevSyms(); usyms = NULL; }