Always lock the HIDAPI device when closing, in case rumble is pending

This commit is contained in:
Sam Lantinga 2021-01-14 23:49:20 -08:00
parent 907b8eebc3
commit e2f46ed8ef
9 changed files with 103 additions and 59 deletions

View file

@ -1221,9 +1221,7 @@ 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;