libSDL3_test: don't remove windows and renders when quiting

This fixes a "DEBUG: Parameter 'texture' is invalid" message when exiting testcamera.
This commit is contained in:
Anonymous Maarten 2024-05-13 16:15:21 +02:00 committed by Anonymous Maarten
parent a7d4ee05f6
commit 18225f7bb5
1 changed files with 0 additions and 23 deletions

View File

@ -2039,29 +2039,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event
}
switch (event->type) {
case SDL_EVENT_WINDOW_CLOSE_REQUESTED:
{
SDL_Window *window = SDL_GetWindowFromID(event->window.windowID);
if (window) {
/* Clear cache to avoid stale textures */
SDLTest_CleanupTextDrawing();
for (i = 0; i < state->num_windows; ++i) {
if (window == state->windows[i]) {
if (state->targets[i]) {
SDL_DestroyTexture(state->targets[i]);
state->targets[i] = NULL;
}
if (state->renderers[i]) {
SDL_DestroyRenderer(state->renderers[i]);
state->renderers[i] = NULL;
}
SDL_DestroyWindow(state->windows[i]);
state->windows[i] = NULL;
break;
}
}
}
} break;
case SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED:
if (state->auto_scale_content) {
SDL_Window *window = SDL_GetWindowFromID(event->window.windowID);