Browse Source

Remember to close the game controller when we're done with it

Sam Lantinga 4 years ago
parent
commit
04f0fd13b5
1 changed files with 2 additions and 0 deletions
  1. 2 0
      test/testgamecontroller.c

+ 2 - 0
test/testgamecontroller.c

@@ -191,6 +191,8 @@ static void DelController(SDL_JoystickID controller)
         return;
     }
 
+    SDL_GameControllerClose(gamecontrollers[i]);
+
     --num_controllers;
     if (i < num_controllers) {
         SDL_memcpy(&gamecontrollers[i], &gamecontrollers[i+1], (num_controllers - i) * sizeof(*gamecontrollers));