RequestWorker: take unique ptr (fixes regression)

This commit is contained in:
Albert S. 2019-09-29 21:34:21 +02:00
rodzic 8364ace683
commit ec10c764d5
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -137,7 +137,7 @@ int main(int argc, char **argv)
cache->clear();
HandlerFactory handlerFactory{config.handlersConfig, siteTemplate, *database.get(), urlProvider, *cache.get()};
RequestWorker requestWorker{handlerFactory, *database->createSessionDao().get(), siteTemplate};
RequestWorker requestWorker{handlerFactory, database->createSessionDao(), siteTemplate};
auto interface = createGateway(config);

Wyświetl plik

@ -17,17 +17,17 @@ class RequestWorker
UrlProvider *urlProvider;
ICache *cache;
HandlerFactory *handlerFactory;
SessionDao *sessionDao;
std::unique_ptr<SessionDao> sessionDao;
private:
Session retrieveSession(std::string token) const;
public:
RequestWorker(HandlerFactory &handlerFactory, SessionDao &sessionDao, Template &templ)
RequestWorker(HandlerFactory &handlerFactory, std::unique_ptr<SessionDao> sessionDao, Template &templ)
{
this->handlerFactory = &handlerFactory;
this->templ = &templ;
this->sessionDao = &sessionDao;
this->sessionDao = std::move(sessionDao);
}
Response processRequest(const Request &r);