diff --git a/ext/ghoul b/ext/ghoul index 8264b80955..2081cc59d5 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 8264b80955fab966feffe6364125931f960428e6 +Subproject commit 2081cc59d5a5cf59d679e7363ea42c8cee19078a diff --git a/modules/server/src/connection.cpp b/modules/server/src/connection.cpp index acb284217d..43b9f3d82e 100644 --- a/modules/server/src/connection.cpp +++ b/modules/server/src/connection.cpp @@ -83,8 +83,14 @@ Connection::Connection(std::unique_ptr s, _topicFactory.registerClass( AuthenticationTopicKey, - [password](bool, const ghoul::Dictionary&) { - return new AuthorizationTopic(password); + [password](bool, const ghoul::Dictionary&, ghoul::MemoryPoolBase* pool) { + if (pool) { + void* ptr = pool->alloc(sizeof(AuthorizationTopic)); + return new (ptr) AuthorizationTopic(password); + } + else { + return new AuthorizationTopic(password); + } } ); diff --git a/modules/sync/syncmodule.cpp b/modules/sync/syncmodule.cpp index 0bba0d59a0..582b7f2146 100644 --- a/modules/sync/syncmodule.cpp +++ b/modules/sync/syncmodule.cpp @@ -78,22 +78,41 @@ void SyncModule::internalInitialize(const ghoul::Dictionary& configuration) { fSynchronization->registerClass( "HttpSynchronization", - [this](bool, const ghoul::Dictionary& dictionary) { - return new HttpSynchronization( - dictionary, - _synchronizationRoot, - _synchronizationRepositories - ); + [this](bool, const ghoul::Dictionary& dictionary, ghoul::MemoryPoolBase* pool) { + if (pool) { + void* ptr = pool->alloc(sizeof(HttpSynchronization)); + return new (ptr) HttpSynchronization( + dictionary, + _synchronizationRoot, + _synchronizationRepositories + ); + } + else { + return new HttpSynchronization( + dictionary, + _synchronizationRoot, + _synchronizationRepositories + ); + } } ); fSynchronization->registerClass( "UrlSynchronization", - [this](bool, const ghoul::Dictionary& dictionary) { - return new UrlSynchronization( - dictionary, - _synchronizationRoot - ); + [this](bool, const ghoul::Dictionary& dictionary, ghoul::MemoryPoolBase* pool) { + if (pool) { + void* ptr = pool->alloc(sizeof(UrlSynchronization)); + return new (ptr) UrlSynchronization( + dictionary, + _synchronizationRoot + ); + } + else { + return new UrlSynchronization( + dictionary, + _synchronizationRoot + ); + } } ); diff --git a/src/util/factorymanager.cpp b/src/util/factorymanager.cpp index 4a033832ef..3796976382 100644 --- a/src/util/factorymanager.cpp +++ b/src/util/factorymanager.cpp @@ -70,7 +70,7 @@ FactoryManager& FactoryManager::ref() { return *_manager; } -void FactoryManager::addFactory(std::unique_ptr> f, +void FactoryManager::addFactory(std::unique_ptr f, std::string name) { ghoul_assert(f, "Factory must not be nullptr"); @@ -87,7 +87,7 @@ std::string FactoryManager::generateJson() const { json << "\"name\": \"" << factoryInfo.name << "\","; json << "\"classes\": ["; - ghoul::TemplateFactoryBase<>* f = factoryInfo.factory.get(); + ghoul::TemplateFactoryBase* f = factoryInfo.factory.get(); const std::vector& registeredClasses = f->registeredClasses(); for (const std::string& c : registeredClasses) { json << "\"" << c << "\"";