Explorar o código

Make sure the HIDAPI device is locked when closing it, in case there is rumble pending that didn't complete

Sam Lantinga %!s(int64=5) %!d(string=hai) anos
pai
achega
907b8eebc3
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/joystick/hidapi/SDL_hidapijoystick.c

+ 2 - 0
src/joystick/hidapi/SDL_hidapijoystick.c

@@ -1221,7 +1221,9 @@ HIDAPI_JoystickClose(SDL_Joystick * joystick)
             SDL_LockMutex(device->dev_lock);
         }
 
+        SDL_LockMutex(device->dev_lock);
         device->driver->CloseJoystick(device, joystick);
+        SDL_UnlockMutex(device->dev_lock);
 
         SDL_free(joystick->hwdata);
         joystick->hwdata = NULL;