mirror of https://github.com/Icinga/icinga2.git
parent
a134882567
commit
7d93788650
|
@ -108,7 +108,7 @@ void Application::Exit(int rc)
|
|||
logger->Flush();
|
||||
}
|
||||
|
||||
Timer::Uninitialize();
|
||||
UninitializeBase();
|
||||
|
||||
#ifdef _DEBUG
|
||||
exit(rc);
|
||||
|
@ -149,6 +149,18 @@ void Application::InitializeBase(void)
|
|||
#endif /* _WIN32 */
|
||||
|
||||
Utility::ExecuteDeferredInitializers();
|
||||
|
||||
/* make sure the thread pool gets initialized */
|
||||
GetTP();
|
||||
|
||||
Timer::Initialize();
|
||||
}
|
||||
|
||||
void Application::UninitializeBase(void)
|
||||
{
|
||||
Timer::Uninitialize();
|
||||
|
||||
GetTP().Stop();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -316,12 +328,7 @@ mainloop:
|
|||
DynamicObject::StopObjects();
|
||||
Application::GetInstance()->OnShutdown();
|
||||
|
||||
#ifdef _DEBUG
|
||||
GetTP().Stop();
|
||||
m_ShuttingDown = false;
|
||||
|
||||
Timer::Uninitialize();
|
||||
#endif /* _DEBUG */
|
||||
UninitializeBase();
|
||||
}
|
||||
|
||||
void Application::OnShutdown(void)
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
~Application(void);
|
||||
|
||||
static void InitializeBase(void);
|
||||
static void UninitializeBase(void);
|
||||
|
||||
static Application::Ptr GetInstance(void);
|
||||
|
||||
|
|
|
@ -52,9 +52,6 @@ public:
|
|||
|
||||
boost::signals2::signal<void(const Timer::Ptr&)> OnTimerExpired;
|
||||
|
||||
static void Initialize(void);
|
||||
static void Uninitialize(void);
|
||||
|
||||
class Holder {
|
||||
public:
|
||||
Holder(Timer *timer)
|
||||
|
@ -88,6 +85,11 @@ private:
|
|||
void Call();
|
||||
|
||||
static void TimerThreadProc(void);
|
||||
|
||||
static void Initialize(void);
|
||||
static void Uninitialize(void);
|
||||
|
||||
friend class Application;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -31,12 +31,11 @@ struct InitLibBase
|
|||
InitLibBase(void)
|
||||
{
|
||||
Application::InitializeBase();
|
||||
Timer::Initialize();
|
||||
}
|
||||
|
||||
~InitLibBase(void)
|
||||
{
|
||||
Timer::Uninitialize();
|
||||
Application::UninitializeBase();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue