[Commits] SDL: safer this way, just in case..

libsdl.org revision control commits-owner at libsdl.org
Mon Sep 24 23:21:12 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/0be7fc59830a
changeset: 12206:0be7fc59830a
user:      Ozkan Sezer <sezeroz at gmail.com>
date:      Tue Sep 25 09:20:56 2018 +0300
description:
safer this way, just in case..

diffstat:

 src/joystick/hidapi/SDL_hidapijoystick.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (23 lines):

diff -r 483789136c52 -r 0be7fc59830a src/joystick/hidapi/SDL_hidapijoystick.c
--- a/src/joystick/hidapi/SDL_hidapijoystick.c	Mon Sep 24 20:31:24 2018 -0700
+++ b/src/joystick/hidapi/SDL_hidapijoystick.c	Tue Sep 25 09:20:56 2018 +0300
@@ -376,13 +376,13 @@
 #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;
     }


More information about the commits mailing list