Fixed crash if debug text wasn't drawn during a session

This commit is contained in:
Sam Lantinga 2022-07-22 10:58:29 -07:00
parent 8cd515c324
commit 20f51b1fd7
1 changed files with 2 additions and 2 deletions

View File

@ -3478,7 +3478,7 @@ void SDLTest_CleanupTextDrawing(void)
struct SDLTest_CharTextureCache* cache, *next;
cache = SDLTest_CharTextureCacheList;
do {
while (cache) {
for (i = 0; i < SDL_arraysize(cache->charTextureCache); ++i) {
if (cache->charTextureCache[i]) {
SDL_DestroyTexture(cache->charTextureCache[i]);
@ -3489,7 +3489,7 @@ void SDLTest_CleanupTextDrawing(void)
next = cache->next;
SDL_free(cache);
cache = next;
} while (cache);
}
SDLTest_CharTextureCacheList = NULL;
}