Procházet zdrojové kódy

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

Ryan C. Gordon před 2 roky
rodič
revize
1c6d996108
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      test/testaudio.c

+ 3 - 1
test/testaudio.c

@@ -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);
     }
 }