From ea0260cfc79d93b313b02d9619192e7e0dfc217c Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 7 Feb 2012 16:10:39 +0000 Subject: [PATCH] Fix for OpenGL demo. --- extras/JuceDemo/Source/demos/OpenGLDemo.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/extras/JuceDemo/Source/demos/OpenGLDemo.cpp b/extras/JuceDemo/Source/demos/OpenGLDemo.cpp index 6656c4ed56..254e0d0f78 100644 --- a/extras/JuceDemo/Source/demos/OpenGLDemo.cpp +++ b/extras/JuceDemo/Source/demos/OpenGLDemo.cpp @@ -62,6 +62,11 @@ public: startTimer (1000 / 30); } + ~DemoOpenGLCanvas() + { + stopRenderThread(); + } + // when the component creates a new internal context, this is called, and // we'll use the opportunity to create some images to use as textures. void newOpenGLContextCreated() @@ -70,6 +75,14 @@ public: dynamicTextureImage = Image (Image::ARGB, 128, 128, true, OpenGLImageType()); } + void releaseOpenGLContext() + { + // We have to make sure we release any openGL images before the + // GL context gets closed.. + logoImage = Image::null; + dynamicTextureImage = Image::null; + } + void mouseDown (const MouseEvent& e) { draggableOrientation.mouseDown (e.getPosition());