diff --git a/src/Dispatcher.cpp b/src/Dispatcher.cpp index 7bb650a9e4..d5e3fe325d 100644 --- a/src/Dispatcher.cpp +++ b/src/Dispatcher.cpp @@ -30,6 +30,9 @@ void Dispatcher::StartClient(const char* server_name, unsigned int port) { static_cast(port), 1)); } +Dispatcher::Dispatcher() + : Dispatcher(Storage::GetInstance(), Notifier::GetInstance()) {} + DispatcherBase::DispatcherBase(Storage& storage, Notifier& notifier) : m_storage(storage), m_notifier(notifier) { m_active = false; diff --git a/src/Dispatcher.h b/src/Dispatcher.h index d90233e767..fba1bc9dec 100644 --- a/src/Dispatcher.h +++ b/src/Dispatcher.h @@ -114,7 +114,7 @@ class Dispatcher : public DispatcherBase { void StartClient(const char* server_name, unsigned int port); private: - Dispatcher() : Dispatcher(Storage::GetInstance(), Notifier::GetInstance()) {} + Dispatcher(); Dispatcher(Storage& storage, Notifier& notifier) : DispatcherBase(storage, notifier) {} diff --git a/src/Storage.cpp b/src/Storage.cpp index c2e983b9bf..781cda05f4 100644 --- a/src/Storage.cpp +++ b/src/Storage.cpp @@ -20,6 +20,9 @@ using namespace nt; ATOMIC_STATIC_INIT(Storage) +Storage::Storage() + : Storage(Notifier::GetInstance(), RpcServer::GetInstance()) {} + Storage::Storage(Notifier& notifier, RpcServer& rpc_server) : m_notifier(notifier), m_rpc_server(rpc_server) { m_terminating = false; diff --git a/src/Storage.h b/src/Storage.h index 9cbf8b63db..a5901106f5 100644 --- a/src/Storage.h +++ b/src/Storage.h @@ -99,7 +99,7 @@ class Storage { bool GetRpcResult(bool blocking, unsigned int call_uid, std::string* result); private: - Storage() : Storage(Notifier::GetInstance(), RpcServer::GetInstance()) {} + Storage(); Storage(Notifier& notifier, RpcServer& rpcserver); Storage(const Storage&) = delete; Storage& operator=(const Storage&) = delete;