Skip to content

Commit

Permalink
Remember to close the game controller when we're done with it
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 28, 2020
1 parent 1f2f536 commit 04f0fd1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/testgamecontroller.c
Expand Up @@ -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));
Expand Down

0 comments on commit 04f0fd1

Please sign in to comment.