From ffdca018007b0b499c74df463db5ce1faf025a21 Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 4 May 2012 13:00:01 +0100 Subject: [PATCH] openGL: deactivating context on shutdown. --- modules/juce_opengl/native/juce_OpenGL_ios.h | 1 + modules/juce_opengl/native/juce_OpenGL_osx.h | 2 +- modules/juce_opengl/native/juce_OpenGL_win32.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/juce_opengl/native/juce_OpenGL_ios.h b/modules/juce_opengl/native/juce_OpenGL_ios.h index e750ff2f7a..51927d0d43 100644 --- a/modules/juce_opengl/native/juce_OpenGL_ios.h +++ b/modules/juce_opengl/native/juce_OpenGL_ios.h @@ -99,6 +99,7 @@ public: { JUCE_CHECK_OPENGL_ERROR freeGLBuffers(); + deactivateCurrentContext(); } bool createdOk() const noexcept { return getRawContext() != nullptr; } diff --git a/modules/juce_opengl/native/juce_OpenGL_osx.h b/modules/juce_opengl/native/juce_OpenGL_osx.h index cf1fa4c21e..3f43cbc20c 100644 --- a/modules/juce_opengl/native/juce_OpenGL_osx.h +++ b/modules/juce_opengl/native/juce_OpenGL_osx.h @@ -163,7 +163,7 @@ public: } void initialiseOnRenderThread() {} - void shutdownOnRenderThread() {} + void shutdownOnRenderThread() { deactivateCurrentContext(); } bool createdOk() const noexcept { return getRawContext() != nullptr; } void* getRawContext() const noexcept { return static_cast (renderContext); } diff --git a/modules/juce_opengl/native/juce_OpenGL_win32.h b/modules/juce_opengl/native/juce_OpenGL_win32.h index bc8fffd7e6..565f06ad35 100644 --- a/modules/juce_opengl/native/juce_OpenGL_win32.h +++ b/modules/juce_opengl/native/juce_OpenGL_win32.h @@ -82,7 +82,7 @@ public: } void initialiseOnRenderThread() {} - void shutdownOnRenderThread() {} + void shutdownOnRenderThread() { deactivateCurrentContext(); } static void deactivateCurrentContext() { wglMakeCurrent (0, 0); } bool makeActive() const noexcept { return wglMakeCurrent (dc, renderContext) != FALSE; }