From 14954cc426a97bba4f36c763cfde9c80e9ae63da Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 31 May 2018 18:54:29 +1000 Subject: [PATCH] [client] fix too early release of OpenGL context Fixes a problem where resolution changes would require a restart of the client --- client/renderers/opengl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/renderers/opengl.c b/client/renderers/opengl.c index b9c26800..6f23dd97 100644 --- a/client/renderers/opengl.c +++ b/client/renderers/opengl.c @@ -191,6 +191,12 @@ void opengl_deinitialize(void * opaque) if (this->mouseData) free(this->mouseData); + if (this->glContext) + { + SDL_GL_DeleteContext(this->glContext); + this->glContext = NULL; + } + LG_LOCK_FREE(this->formatLock); LG_LOCK_FREE(this->syncLock ); LG_LOCK_FREE(this->mouseLock ); @@ -993,12 +999,6 @@ static void deconfigure(struct Inst * this) } } - if (this->glContext) - { - SDL_GL_DeleteContext(this->glContext); - this->glContext = NULL; - } - if (this->decoderData) { this->decoder->destroy(this->decoderData);