From c77e8a73ccc1c749c48d8534b731283e6928f95e Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 10 Jul 2025 12:19:48 +0100 Subject: [PATCH] OpenGLContext (Android): Avoid potentially enqueuing work after context has already stopped --- modules/juce_opengl/opengl/juce_OpenGLContext.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp index f1acbf6c4c..27f8ace149 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp @@ -193,10 +193,6 @@ public: //============================================================================== void pause() { - #if JUCE_ANDROID - context.executeOnGLThread ([this] (auto&) { nativeContext->notifyWillPause(); }, true); - #endif - renderThread->remove (this); if ((state.fetch_and (~StateFlags::initialised) & StateFlags::initialised) == 0) @@ -205,6 +201,10 @@ public: ScopedContextActivator activator; activator.activate (context); + #if JUCE_ANDROID + nativeContext->notifyWillPause(); + #endif + if (context.renderer != nullptr) context.renderer->openGLContextClosing();