mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-20 11:55:33 +00:00
Allow return status to be specified using quitWithStatus.
This commit is contained in:
parent
d08e594316
commit
9f47032522
13 changed files with 52 additions and 18 deletions
|
|
@ -43,15 +43,21 @@ static Process* _theOneProcess = NULL; ///< the one instance of the Process clas
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void Process::requestShutdown()
|
||||
void Process::requestShutdown(S32 status)
|
||||
{
|
||||
Process::get()._RequestShutdown = true;
|
||||
Process::get()._ReturnStatus = status;
|
||||
}
|
||||
|
||||
S32 Process::getReturnStatus()
|
||||
{
|
||||
return Process::get()._ReturnStatus;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Process::Process()
|
||||
: _RequestShutdown( false )
|
||||
: _RequestShutdown( false ), _ReturnStatus( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public:
|
|||
static bool processEvents();
|
||||
|
||||
/// Ask the processEvents() function to shutdown.
|
||||
static void requestShutdown();
|
||||
static void requestShutdown(S32 status = 0);
|
||||
|
||||
|
||||
static void notifyInit(Delegate<bool()> del, F32 order = PROCESS_DEFAULT_ORDER)
|
||||
|
|
@ -149,6 +149,9 @@ public:
|
|||
/// Trigger the registered shutdown functions
|
||||
static bool shutdown();
|
||||
|
||||
/// get the current return status code we've been asked to end with.
|
||||
static S32 getReturnStatus();
|
||||
|
||||
private:
|
||||
friend class StandardMainLoop;
|
||||
|
||||
|
|
@ -167,6 +170,7 @@ private:
|
|||
Signal<bool()> _signalShutdown;
|
||||
|
||||
bool _RequestShutdown;
|
||||
S32 _ReturnStatus;
|
||||
};
|
||||
|
||||
/// Register a command line handling function.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue