Browse Source

MessageManager: Use RAII to simplify app delegate cleanup

tags/2021-05-28
reuk 4 years ago
parent
commit
8d5c27237e
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      modules/juce_events/native/juce_mac_MessageManager.mm

+ 2
- 3
modules/juce_events/native/juce_mac_MessageManager.mm 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;
}


Loading…
Cancel
Save