1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

OpenGLContext (Android): Avoid potentially enqueuing work after context has already stopped

This commit is contained in:
reuk 2025-07-10 12:19:48 +01:00
parent 07a7c04d54
commit c77e8a73cc
No known key found for this signature in database

View file

@ -193,10 +193,6 @@ public:
//============================================================================== //==============================================================================
void pause() void pause()
{ {
#if JUCE_ANDROID
context.executeOnGLThread ([this] (auto&) { nativeContext->notifyWillPause(); }, true);
#endif
renderThread->remove (this); renderThread->remove (this);
if ((state.fetch_and (~StateFlags::initialised) & StateFlags::initialised) == 0) if ((state.fetch_and (~StateFlags::initialised) & StateFlags::initialised) == 0)
@ -205,6 +201,10 @@ public:
ScopedContextActivator activator; ScopedContextActivator activator;
activator.activate (context); activator.activate (context);
#if JUCE_ANDROID
nativeContext->notifyWillPause();
#endif
if (context.renderer != nullptr) if (context.renderer != nullptr)
context.renderer->openGLContextClosing(); context.renderer->openGLContextClosing();