summaryrefslogtreecommitdiffstats
path: root/src/Core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core')
-rw-r--r--src/Core/ConnectionManager.cpp6
-rw-r--r--src/Core/ConnectionManager.h13
2 files changed, 10 insertions, 9 deletions
diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp
index 63b29e1..c347e29 100644
--- a/src/Core/ConnectionManager.cpp
+++ b/src/Core/ConnectionManager.cpp
@@ -42,7 +42,7 @@
namespace Mad {
namespace Core {
-Common::SingletonPtr<ConnectionManager> ConnectionManager::connectionManager;
+ConnectionManager ConnectionManager::connectionManager;
void ConnectionManager::updateState(const std::string &name, Common::HostInfo::State state) {
@@ -129,7 +129,7 @@ void ConnectionManager::configFinished() {
}
}
-ConnectionManager::ConnectionManager() {
+void ConnectionManager::doInit() {
Common::RequestManager::get()->setCore(true);
Net::Connection::init();
@@ -146,7 +146,7 @@ ConnectionManager::ConnectionManager() {
Common::RequestManager::get()->registerPacketType<RequestHandlers::LogRequestHandler>(Net::Packet::LOG);
}
-ConnectionManager::~ConnectionManager() {
+void ConnectionManager::doDeinit() {
for(std::list<Net::ServerConnection*>::iterator con = daemonConnections.begin(); con != daemonConnections.end(); ++con)
delete *con;
diff --git a/src/Core/ConnectionManager.h b/src/Core/ConnectionManager.h
index fdc8a46..4623ab6 100644
--- a/src/Core/ConnectionManager.h
+++ b/src/Core/ConnectionManager.h
@@ -29,7 +29,6 @@
#include <Common/HostInfo.h>
#include <Common/Initializable.h>
#include <Common/RequestManager.h>
-#include <Common/SingletonPtr.h>
#include <Net/IPAddress.h>
@@ -46,7 +45,7 @@ namespace Core {
class ConnectionManager : public Common::Configurable, public Common::Initializable {
private:
- static Common::SingletonPtr<ConnectionManager> connectionManager;
+ static ConnectionManager connectionManager;
std::string x509TrustFile, x509CrlFile, x509CertFile, x509KeyFile;
@@ -67,16 +66,18 @@ class ConnectionManager : public Common::Configurable, public Common::Initializa
void updateState(const std::string &name, Common::HostInfo::State state);
+ ConnectionManager() {}
+
protected:
virtual bool handleConfigEntry(const Common::ConfigEntry &entry, bool handled);
virtual void configFinished();
- public:
- ConnectionManager();
- virtual ~ConnectionManager();
+ virtual void doInit();
+ virtual void doDeinit();
+ public:
static ConnectionManager* get() {
- return connectionManager.get();
+ return &connectionManager;
}
void run();