mirror of
https://github.com/yawut/SDL.git
synced 2026-08-02 00:15:12 -05:00
Better fix, iterate backwards over the array so we don't care whether the close code shuffles things down.
This commit is contained in:
parent
1dc86eeece
commit
0d371acf8e
|
|
@ -403,8 +403,8 @@ SDL_JoystickQuit(void)
|
|||
/* Stop the event polling */
|
||||
SDL_numjoysticks = 0;
|
||||
|
||||
for (i = 0; i < numsticks; i++) {
|
||||
SDL_Joystick *stick = SDL_joysticks[0];
|
||||
for (i = numjoysticks; i--; ) {
|
||||
SDL_Joystick *stick = SDL_joysticks[i];
|
||||
if (stick && (stick->ref_count >= 1)) {
|
||||
stick->ref_count = 1;
|
||||
SDL_JoystickClose(stick);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user