Forráskód Böngészése

Only free debug_char_texture_atlas if it has been allocated

Fixes https://github.com/libsdl-org/SDL/issues/11254
Sam Lantinga 6 hónapja
szülő
commit
c5e1ae4580
1 módosított fájl, 4 hozzáadás és 2 törlés
  1. 4 2
      src/render/SDL_render.c

+ 4 - 2
src/render/SDL_render.c

@@ -5098,8 +5098,10 @@ void SDL_DestroyRendererWithoutFreeing(SDL_Renderer *renderer)
 
     SDL_DiscardAllCommands(renderer);
 
-    SDL_DestroyTexture(renderer->debug_char_texture_atlas);
-    renderer->debug_char_texture_atlas = NULL;
+    if (renderer->debug_char_texture_atlas) {
+        SDL_DestroyTexture(renderer->debug_char_texture_atlas);
+        renderer->debug_char_texture_atlas = NULL;
+    }
 
     // Free existing textures for this renderer
     while (renderer->textures) {