RequestWorker: take unique ptr (fixes regression)
This commit is contained in:
orang tua
bae6ae73bf
melakukan
9bb1fa5a33
@ -142,7 +142,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);
|
||||
|
||||
|
@ -17,16 +17,16 @@ 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);
|
||||
|
||||
}
|
||||
|
||||
|
Memuat…
Reference in New Issue
Block a user