mirror of https://github.com/Icinga/icinga2.git
parent
e5bd573756
commit
f592a13481
|
@ -109,7 +109,7 @@ void Application::Exit(int rc)
|
||||||
logger->Flush();
|
logger->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
UninitializeBase();
|
Timer::Uninitialize();
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
exit(rc);
|
exit(rc);
|
||||||
|
@ -120,8 +120,6 @@ void Application::Exit(int rc)
|
||||||
|
|
||||||
void Application::InitializeBase(void)
|
void Application::InitializeBase(void)
|
||||||
{
|
{
|
||||||
Timer::Initialize();
|
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
rlimit rl;
|
rlimit rl;
|
||||||
if (getrlimit(RLIMIT_NOFILE, &rl) >= 0) {
|
if (getrlimit(RLIMIT_NOFILE, &rl) >= 0) {
|
||||||
|
@ -154,11 +152,6 @@ void Application::InitializeBase(void)
|
||||||
Utility::ExecuteDeferredInitializers();
|
Utility::ExecuteDeferredInitializers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::UninitializeBase(void)
|
|
||||||
{
|
|
||||||
Timer::Uninitialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a pointer to the application singleton object.
|
* Retrieves a pointer to the application singleton object.
|
||||||
*
|
*
|
||||||
|
|
|
@ -43,7 +43,6 @@ public:
|
||||||
~Application(void);
|
~Application(void);
|
||||||
|
|
||||||
static void InitializeBase(void);
|
static void InitializeBase(void);
|
||||||
static void UninitializeBase(void);
|
|
||||||
|
|
||||||
static Application::Ptr GetInstance(void);
|
static Application::Ptr GetInstance(void);
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,8 @@ void Timer::Uninitialize(void)
|
||||||
l_CV.notify_all();
|
l_CV.notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
l_Thread.join();
|
if (l_Thread.joinable())
|
||||||
|
l_Thread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#define BOOST_TEST_MODULE icinga2_test
|
#define BOOST_TEST_MODULE icinga2_test
|
||||||
|
|
||||||
#include "base/application.hpp"
|
#include "base/application.hpp"
|
||||||
|
#include "base/timer.hpp"
|
||||||
#include <BoostTestTargetConfig.h>
|
#include <BoostTestTargetConfig.h>
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
@ -30,11 +31,12 @@ struct InitLibBase
|
||||||
InitLibBase(void)
|
InitLibBase(void)
|
||||||
{
|
{
|
||||||
Application::InitializeBase();
|
Application::InitializeBase();
|
||||||
|
Timer::Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
~InitLibBase(void)
|
~InitLibBase(void)
|
||||||
{
|
{
|
||||||
Application::UninitializeBase();
|
Timer::Uninitialize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue