Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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

… the close code shuffles things down.
  • Loading branch information
slouken committed Nov 29, 2011
1 parent 0ea44e9 commit fe87f982d1d454ad9aaf8f668b898d48bb968560
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/joystick/SDL_joystick.c
@@ -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);

0 comments on commit fe87f98

Please sign in to comment.