Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Don't try to clear errors in GL_ActivateRenderer() before we MakeCurr…
Browse files Browse the repository at this point in the history
…ent.

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.
  • Loading branch information
icculus committed Jul 21, 2013
1 parent 11810c0 commit 3fc8f71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/render/opengl/SDL_render_gl.c
Expand Up @@ -277,7 +277,6 @@ GL_ActivateRenderer(SDL_Renderer * renderer)
{
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;
Expand All @@ -286,6 +285,9 @@ GL_ActivateRenderer(SDL_Renderer * renderer)

GL_UpdateViewport(renderer);
}

GL_ClearErrors(renderer);

return 0;
}

Expand Down

0 comments on commit 3fc8f71

Please sign in to comment.