Commit f98e8867 authored by Sam Lantinga's avatar Sam Lantinga

Better fix, iterate backwards over the array so we don't care whether the...

Better fix, iterate backwards over the array so we don't care whether the close code shuffles things down.
parent 22e0d6fa
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment