diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2025-05-07 21:27:33 +0200 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2025-05-07 21:27:33 +0200 |
| commit | fd525a037e7a26ecf5a4dbd92075ef81187e038c (patch) | |
| tree | 447411dd302ae53eca68a96cd8566c0cf3f1a837 | |
| parent | ad140e3926effe3d078e3095cafb977ebdbd8734 (diff) | |
Close Gamepads
Make sure to close gamepads on tear-down.
| -rw-r--r-- | platform/sdl/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/platform/sdl/main.c b/platform/sdl/main.c index 4dd7a7b..23a0aa8 100644 --- a/platform/sdl/main.c +++ b/platform/sdl/main.c @@ -270,6 +270,9 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) { void SDL_AppQuit(void *appstate, SDL_AppResult result) { struct appstate *state = appstate; + for (size_t i = 0; i < SDL_arraysize(state->gamepads); i++) { + SDL_CloseGamepad(state->gamepads[i]); + } SDL_DestroyTexture(state->fb); SDL_DestroyRenderer(state->renderer); SDL_DestroyWindow(state->window); |
