1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-02 03:20:06 +00:00

MessageManager: Use RAII to simplify app delegate cleanup

This commit is contained in:
reuk 2021-01-14 22:02:43 +00:00
parent 5629927c63
commit 8d5c27237e
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -436,17 +436,16 @@ void initialiseNSApplication()
}
}
static AppDelegate* appDelegate = nullptr;
static std::unique_ptr<AppDelegate> appDelegate;
void MessageManager::doPlatformSpecificInitialisation()
{
if (appDelegate == nil)
appDelegate = new AppDelegate();
appDelegate.reset (new AppDelegate());
}
void MessageManager::doPlatformSpecificShutdown()
{
delete appDelegate;
appDelegate = nullptr;
}