SDL_test: fix SDLTest_CommonQuit with NULL state

This commit is contained in:
Anonymous Maarten 2024-09-13 19:06:43 +02:00 committed by Anonymous Maarten
parent 0160e9eac6
commit 6a305e1532
1 changed files with 19 additions and 17 deletions

View File

@ -2543,6 +2543,7 @@ void SDLTest_CommonEvent(SDLTest_CommonState *state, SDL_Event *event, int *done
void SDLTest_CommonQuit(SDLTest_CommonState *state)
{
if (state) {
int i;
if (state->targets) {
@ -2567,6 +2568,7 @@ void SDLTest_CommonQuit(SDLTest_CommonState *state)
}
SDL_free(state->windows);
}
}
SDL_Quit();
SDLTest_CommonDestroyState(state);
}