Commit c1ac4c6835bf0a071c2e8799d1959ee3e1bbfeee

Ryan C. Gordon 2017-01-06T21:17:33

Better fix for static analysis issue in SDL_DestroyRenderer(). Follow up fix for Bugzilla #3544.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 8309fab..d31f729 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -1938,7 +1938,9 @@ SDL_DestroyRenderer(SDL_Renderer * renderer)
 
     /* Free existing textures for this renderer */
     while (renderer->textures) {
+        SDL_Texture *tex = renderer->textures;
         SDL_DestroyTexture(renderer->textures);
+        SDL_assert(tex != renderer->textures);  /* satisfy static analysis. */
     }
 
     if (renderer->window) {