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

View File

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