1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-21 01:24:21 +00:00
This commit is contained in:
jules 2007-08-01 08:26:48 +00:00
parent 0f3f2f5fe7
commit d7e2cdc290
4 changed files with 40 additions and 15 deletions

View file

@ -60,7 +60,8 @@ static JUCEApplication* appInstance = 0;
//==============================================================================
JUCEApplication::JUCEApplication()
: stillInitialising (true)
: appReturnValue (0),
stillInitialising (true)
{
}
@ -103,6 +104,11 @@ void JUCEApplication::quit (const bool useMaximumForce)
MessageManager::getInstance()->postQuitMessage (useMaximumForce);
}
void JUCEApplication::setApplicationReturnValue (const int newReturnValue) throw()
{
appReturnValue = newReturnValue;
}
//==============================================================================
void JUCEApplication::unhandledException (const std::exception*,
const String&,
@ -218,15 +224,14 @@ int JUCEApplication::main (String& commandLine, JUCEApplication* const app)
}
#endif
shutdownAppAndClearUp (useForce);
return 0;
return shutdownAppAndClearUp (useForce);
}
void JUCEApplication::shutdownAppAndClearUp (bool useMaximumForce)
int JUCEApplication::shutdownAppAndClearUp (const bool useMaximumForce)
{
jassert (appInstance != 0);
JUCEApplication* const app = appInstance;
int returnValue = 0;
static bool reentrancyCheck = false;
@ -254,6 +259,8 @@ void JUCEApplication::shutdownAppAndClearUp (bool useMaximumForce)
{
shutdownJuce_GUI();
returnValue = app->getApplicationReturnValue();
appInstance = 0;
delete app;
}
@ -266,6 +273,8 @@ void JUCEApplication::shutdownAppAndClearUp (bool useMaximumForce)
reentrancyCheck = false;
}
return returnValue;
}
int JUCEApplication::main (int argc, char* argv[],