mirror of
https://github.com/Icinga/icinga2.git
synced 2026-04-15 22:00:07 -04:00
Check whether there's an application instance before calling Shutdown().
This commit is contained in:
parent
77029763cf
commit
49c7cd27d2
1 changed files with 13 additions and 2 deletions
|
|
@ -437,7 +437,12 @@ void Application::SigIntHandler(int signum)
|
|||
{
|
||||
assert(signum == SIGINT);
|
||||
|
||||
Application::GetInstance()->Shutdown();
|
||||
Application::Ptr instance = Application::GetInstance();
|
||||
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
instance->Shutdown();
|
||||
|
||||
struct sigaction sa;
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
|
|
@ -451,7 +456,13 @@ void Application::SigIntHandler(int signum)
|
|||
*/
|
||||
BOOL WINAPI Application::CtrlHandler(DWORD type)
|
||||
{
|
||||
Application::GetInstance()->Shutdown();
|
||||
Application::Ptr instance = Application::GetInstance();
|
||||
|
||||
if (!instance)
|
||||
return TRUE;
|
||||
|
||||
instance->GetInstance()->Shutdown();
|
||||
|
||||
SetConsoleCtrlHandler(NULL, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue