Closing the joystick removes it from the list.
authorSam Lantinga <slouken@libsdl.org>
Tue, 29 Nov 2011 02:15:39 -0500
changeset 6096 71a57385664f
parent 6095 32d8fad8d7ad
child 6097 4ea2b4d4937a
Closing the joystick removes it from the list.
src/joystick/SDL_joystick.c
--- a/src/joystick/SDL_joystick.c	Tue Nov 29 02:12:24 2011 -0500
+++ b/src/joystick/SDL_joystick.c	Tue Nov 29 02:15:39 2011 -0500
@@ -404,7 +404,7 @@
     SDL_numjoysticks = 0;
 
     for (i = 0; i < numsticks; i++) {
-        SDL_Joystick *stick = SDL_joysticks[i];
+        SDL_Joystick *stick = SDL_joysticks[0];
         if (stick && (stick->ref_count >= 1)) {
             stick->ref_count = 1;
             SDL_JoystickClose(stick);