Fixed some issues found with static analysis

This commit is contained in:
Sam Lantinga
2024-07-26 23:35:30 -07:00
parent 218e45247f
commit b854e1fe0b
6 changed files with 41 additions and 14 deletions

View File

@@ -561,10 +561,12 @@ int main(int argc, char *argv[])
#endif
done:
for (i = 0; i < state->num_windows; ++i) {
SDLTest_TextWindowDestroy(windowstates[i].textwindow);
if (windowstates) {
for (i = 0; i < state->num_windows; ++i) {
SDLTest_TextWindowDestroy(windowstates[i].textwindow);
}
SDL_free(windowstates);
}
SDL_free(windowstates);
SDLTest_CleanupTextDrawing();
SDLTest_CommonQuit(state);
return 0;