1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

Android: Allow multiple instances of ScopedJuceInitialiser_GUI

Previously, the UnitTestRunner example in the DemoRunner would fail on
any tests that included ScopedJuceInitialiser_GUI, as DeletedAtShutdown
objects would be destroyed too early.
This commit is contained in:
reuk 2024-02-27 16:06:47 +00:00
parent bafd0d293b
commit 238a99caf8
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -267,7 +267,7 @@ private:
JUCEApplicationBase::createInstance = createApplicationSymbol;
initialiseJuce_GUI();
initialiser.emplace();
if (! JUCEApplicationBase::createInstance())
jassertfalse; // you must supply an application object for an android app!
@ -292,6 +292,7 @@ private:
}
}
std::optional<ScopedJuceInitialiser_GUI> initialiser;
GlobalRef myself;
juce::JUCEApplicationBase* (*createApplicationSymbol)();
bool hasBeenInitialised = false;