Don't try to clear errors in GL_ActivateRenderer() before we MakeCurrent.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 20 Jul 2013 21:10:05 -0400
changeset 7486 c074c0b23916
parent 7485 6ffa71faa50b
child 7487 a4e43eb67e79
Don't try to clear errors in GL_ActivateRenderer() before we MakeCurrent. Otherwise, if we destroyed a different renderer, next time this one draws, it'll clear errors forever (GL_INVALID_OPERATION for having no current context, at least on Windows), hanging up the program in an infinite loop. Fixes Bugzilla #1775.
src/render/opengl/SDL_render_gl.c
--- a/src/render/opengl/SDL_render_gl.c	Sat Jul 20 20:12:36 2013 -0400
+++ b/src/render/opengl/SDL_render_gl.c	Sat Jul 20 21:10:05 2013 -0400
@@ -277,7 +277,6 @@
 {
     GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
 
-    GL_ClearErrors(renderer);
     if (SDL_CurrentContext != data->context) {
         if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) {
             return -1;
@@ -286,6 +285,9 @@
 
         GL_UpdateViewport(renderer);
     }
+
+    GL_ClearErrors(renderer);
+
     return 0;
 }