[Commits] SDL: render: GL_DestroyRender() should activate first.

libsdl.org revision control commits-owner at libsdl.org
Thu May 18 18:00:18 PDT 2017


details:   https://hg.libsdl.org/SDL/rev/06a6583f0fda
changeset: 11013:06a6583f0fda
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Thu May 18 21:00:11 2017 -0400
description:
render: GL_DestroyRender() should activate first.

Otherwise, we might destroy a different GL context's resources.

diffstat:

 src/render/opengl/SDL_render_gl.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r c2f18f1f7e97 -r 06a6583f0fda src/render/opengl/SDL_render_gl.c
--- a/src/render/opengl/SDL_render_gl.c	Thu May 18 16:29:10 2017 -0400
+++ b/src/render/opengl/SDL_render_gl.c	Thu May 18 21:00:11 2017 -0400
@@ -1523,6 +1523,11 @@
     GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
 
     if (data) {
+        if (data->context != NULL) {
+            /* make sure we delete the right resources! */
+            GL_ActivateRenderer(renderer);
+        }
+
         GL_ClearErrors(renderer);
         if (data->GL_ARB_debug_output_supported) {
             PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB");


More information about the commits mailing list