Fixed error message when destroying a software renderer, thanks to wahono for the patch.
authorSam Lantinga <slouken@libsdl.org>
Thu, 06 Sep 2012 21:34:52 -0700
changeset 6417 e54cc2d4e89a
parent 6416 a6bd06626407
child 6418 9c12f2c8057b
Fixed error message when destroying a software renderer, thanks to wahono for the patch.
src/render/SDL_render.c
--- a/src/render/SDL_render.c	Tue Sep 04 23:17:56 2012 -0700
+++ b/src/render/SDL_render.c	Thu Sep 06 21:34:52 2012 -0700
@@ -1373,7 +1373,9 @@
         SDL_DestroyTexture(renderer->textures);
     }
 
-    SDL_SetWindowData(renderer->window, SDL_WINDOWRENDERDATA, NULL);
+    if (renderer->window) {
+        SDL_SetWindowData(renderer->window, SDL_WINDOWRENDERDATA, NULL);
+    }
 
     /* It's no longer magical... */
     renderer->magic = NULL;