Browse Source

Call SDL_UDEV_Quit() if we don't end up using it

Sam Lantinga 3 months ago
parent
commit
e5a4f09363
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/joystick/linux/SDL_sysjoystick.c

+ 4 - 0
src/joystick/linux/SDL_sysjoystick.c

@@ -1036,6 +1036,10 @@ static bool LINUX_JoystickInit(void)
                          "udev init failed, disabling udev integration");
             enumeration_method = ENUMERATION_FALLBACK;
         }
+    } else {
+        if (udev_initialized) {
+            SDL_UDEV_Quit();
+        }
     }
 #endif