src/joystick/SDL_joystick.c
changeset 6095 32d8fad8d7ad
parent 5861 b781fa6468aa
child 6096 71a57385664f
equal deleted inserted replaced
6094:5dac1b1261c0 6095:32d8fad8d7ad
   400     const int numsticks = SDL_numjoysticks;
   400     const int numsticks = SDL_numjoysticks;
   401     int i;
   401     int i;
   402 
   402 
   403     /* Stop the event polling */
   403     /* Stop the event polling */
   404     SDL_numjoysticks = 0;
   404     SDL_numjoysticks = 0;
   405 
       
   406     SDL_assert( (SDL_joysticks == NULL) == (numsticks == 0) );
       
   407 
   405 
   408     for (i = 0; i < numsticks; i++) {
   406     for (i = 0; i < numsticks; i++) {
   409         SDL_Joystick *stick = SDL_joysticks[i];
   407         SDL_Joystick *stick = SDL_joysticks[i];
   410         if (stick && (stick->ref_count >= 1)) {
   408         if (stick && (stick->ref_count >= 1)) {
   411             stick->ref_count = 1;
   409             stick->ref_count = 1;