Steps to reproduce(from the tip)
- Put a break in shutdown in ApplicationStartup in the JUCE Demo
- Make sure this is hitting properly by clicking close button on the Juce demo. The breakpoint will be hit
- Re-launch under the debugger, click once on the window’s titlebar to give it focus(or to take focus away from the window’s components)
- Now use the mouse to go to the mac menu and choose quit, the breakpoint is not hit.
Point # 4 should go through the class AppDelegateRedirector, I think the NSTerminateNow is the problem.
virtual NSApplicationTerminateReply shouldTerminate()
{
if (JUCEApplication::getInstance() != 0)
{
JUCEApplication::getInstance()->systemRequestedQuit();
if (! MessageManager::getInstance()->hasStopMessageBeenSent())
return NSTerminateCancel;
}
return NSTerminateNow;
}