From cd37ba3aa4f1cd9fa01f6a50184338273a260a84 Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 10 Mar 2016 12:09:10 +0000 Subject: [PATCH] Fix for openGL when a GL component is removed from its parent without detaching first. --- modules/juce_opengl/opengl/juce_OpenGLContext.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp index 12aaec37cb..d3f255269a 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp @@ -150,7 +150,10 @@ public: return false; } - void releaseResources() override {} + void releaseResources() override + { + stop(); + } void triggerRepaint() { @@ -237,6 +240,10 @@ public: if (isUpdating) { paintComponent(); + + if (! hasInitialised) + return false; + mmLock = nullptr; lastMMLockReleaseTime = Time::getMillisecondCounter(); }