Fixed memory leak in SDL_DestroyRenderer.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 16 Jul 2011 14:59:12 -0700
changeset 5566 0d221d6ffac8
parent 5564 7ed38a8ad304
child 5567 441c3036440c
Fixed memory leak in SDL_DestroyRenderer. Fixes Bugzilla #1219. Thanks to Dimitris Zenios for the patch!
src/render/opengl/SDL_render_gl.c
--- a/src/render/opengl/SDL_render_gl.c	Sat Jul 16 11:52:09 2011 -0700
+++ b/src/render/opengl/SDL_render_gl.c	Sat Jul 16 14:59:12 2011 -0700
@@ -1011,6 +1011,9 @@
     GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
 
     if (data) {
+        if (data->shaders) {
+            GL_DestroyShaderContext(data->shaders);
+        }
         if (data->context) {
             /* SDL_GL_MakeCurrent(0, NULL); *//* doesn't do anything */
             SDL_GL_DeleteContext(data->context);