mirror of
https://github.com/encounter/SDL.git
synced 2025-05-18 21:31:35 +00:00
Make sure we hold the joystick lock when updating the device state while opening it
This commit is contained in:
parent
d4e0d27c1c
commit
0a05b281f2
@ -573,8 +573,6 @@ SDL_JoystickOpen(int device_index)
|
||||
joystick->next = SDL_joysticks;
|
||||
SDL_joysticks = joystick;
|
||||
|
||||
SDL_UnlockJoysticks();
|
||||
|
||||
/* send initial battery event */
|
||||
initial_power_level = joystick->epowerlevel;
|
||||
joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN;
|
||||
@ -582,6 +580,8 @@ SDL_JoystickOpen(int device_index)
|
||||
|
||||
driver->Update(joystick);
|
||||
|
||||
SDL_UnlockJoysticks();
|
||||
|
||||
return joystick;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user