mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Check whether there's an application instance before calling Shutdown().
This commit is contained in:
parent
77029763cf
commit
49c7cd27d2
@ -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…
x
Reference in New Issue
Block a user