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:
parent
5629927c63
commit
8d5c27237e
1 changed files with 2 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue