Use Application::Exit() for main app termination

refs #6682
This commit is contained in:
Michael Friedrich 2014-08-04 16:43:34 +02:00
parent 51329f0b3c
commit fd233ae901
3 changed files with 7 additions and 7 deletions

View File

@ -595,7 +595,7 @@ int Main(void)
int rc = Application::GetInstance()->Run();
#ifndef _DEBUG
_exit(rc); // Yay, our static destructors are pretty much beyond repair at this point.
Application::Exit(rc);
#endif /* _DEBUG */
return rc;
@ -788,11 +788,11 @@ int main(int argc, char **argv)
};
StartServiceCtrlDispatcher(dispatchTable);
_exit(1);
Application::Exit(1);
}
#endif /* _WIN32 */
int rc = Main();
_exit(rc);
Application::Exit(rc);
}

View File

@ -112,9 +112,9 @@ Application::~Application(void)
m_Instance = NULL;
}
void Application::Exit(int code)
void Application::Exit(int rc)
{
_exit(code);
_exit(rc); // Yay, our static destructors are pretty much beyond repair at this point.
}
void Application::InitializeBase(void)
@ -711,7 +711,7 @@ void Application::UpdatePidFile(const String& filename, pid_t pid)
if (fcntl(fd, F_SETLK, &lock) < 0) {
Log(LogCritical, "Application", "Could not lock PID file. Make sure that only one instance of the application is running.");
_exit(EXIT_FAILURE);
Application::Exit(EXIT_FAILURE);
}
if (ftruncate(fd, 0) < 0) {

View File

@ -46,7 +46,7 @@ public:
static Application::Ptr GetInstance(void);
static void Exit(int code);
static void Exit(int rc);
int Run(void);