Commit 04f0fd13b5dbceee58a74b1003c56a59fbf13e1e

Sam Lantinga 2020-11-27T18:57:42

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

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/test/testgamecontroller.c b/test/testgamecontroller.c
index 57682bb..e9a67e4 100644
--- a/test/testgamecontroller.c
+++ b/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));