render: GL_DestroyRender() should activate first.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 18 May 2017 21:00:11 -0400
changeset 1101306a6583f0fda
parent 11012 c2f18f1f7e97
child 11014 4210074a33c8
render: GL_DestroyRender() should activate first.

Otherwise, we might destroy a different GL context's resources.
src/render/opengl/SDL_render_gl.c
     1.1 --- a/src/render/opengl/SDL_render_gl.c	Thu May 18 16:29:10 2017 -0400
     1.2 +++ b/src/render/opengl/SDL_render_gl.c	Thu May 18 21:00:11 2017 -0400
     1.3 @@ -1523,6 +1523,11 @@
     1.4      GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
     1.5  
     1.6      if (data) {
     1.7 +        if (data->context != NULL) {
     1.8 +            /* make sure we delete the right resources! */
     1.9 +            GL_ActivateRenderer(renderer);
    1.10 +        }
    1.11 +
    1.12          GL_ClearErrors(renderer);
    1.13          if (data->GL_ARB_debug_output_supported) {
    1.14              PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB");