testaudio: if the SDL_Renderer is already gone, don't destroy SDL_Textures.

This commit is contained in:
Ryan C. Gordon
2023-10-14 23:17:59 -04:00
parent b22ffb9797
commit 1c6d996108

View File

@@ -732,7 +732,9 @@ static void LoadStockWavThings(void)
static void DestroyTexture(Texture *tex)
{
if (tex) {
SDL_DestroyTexture(tex->texture);
if (state->renderers[0] != NULL) { /* if the renderer went away, this pointer is already bogus. */
SDL_DestroyTexture(tex->texture);
}
SDL_free(tex);
}
}