diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp index de318764f4..ab62fc92b3 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp @@ -206,6 +206,8 @@ public: } context.swapBuffers(); + + OpenGLContext::deactivateCurrentContext(); return true; } @@ -389,7 +391,9 @@ public: wait (-1); } + context.makeActive(); shutdownOnThread(); + OpenGLContext::deactivateCurrentContext(); } #endif @@ -434,11 +438,10 @@ public: glDeleteVertexArrays (1, &vertexArrayObject); #endif - cachedImageFrameBuffer.release(); - nativeContext->shutdownOnRenderThread(); - associatedObjectNames.clear(); associatedObjects.clear(); + cachedImageFrameBuffer.release(); + nativeContext->shutdownOnRenderThread(); } //==============================================================================