Skip to content
Snippets Groups Projects
Commit c03ba578 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

dhtnode: use explicit unique_ptr constructor

parent e2224fac
No related branches found
No related tags found
No related merge requests found
...@@ -201,9 +201,9 @@ void cmd_loop(std::shared_ptr<DhtRunner>& dht, dht_params& params ...@@ -201,9 +201,9 @@ void cmd_loop(std::shared_ptr<DhtRunner>& dht, dht_params& params
try { try {
unsigned int port = std::stoi(idstr); unsigned int port = std::stoi(idstr);
#if OPENDHT_PUSH_NOTIFICATIONS #if OPENDHT_PUSH_NOTIFICATIONS
proxies.emplace(port, new DhtProxyServer(dht, port, pushServer)); proxies.emplace(port, std::unique_ptr<DhtProxyServer>(new DhtProxyServer(dht, port, pushServer)));
#else #else
proxies.emplace(port, new DhtProxyServer(dht, port)); proxies.emplace(port, std::unique_ptr<DhtProxyServer>(new DhtProxyServer(dht, port)));
#endif // OPENDHT_PUSH_NOTIFICATIONS #endif // OPENDHT_PUSH_NOTIFICATIONS
} catch (...) { } } catch (...) { }
continue; continue;
...@@ -517,7 +517,7 @@ main(int argc, char **argv) ...@@ -517,7 +517,7 @@ main(int argc, char **argv)
#endif #endif
if (params.proxyserver != 0) { if (params.proxyserver != 0) {
#if OPENDHT_PROXY_SERVER #if OPENDHT_PROXY_SERVER
proxies.emplace(params.proxyserver, new DhtProxyServer(dht, params.proxyserver, params.pushserver)); proxies.emplace(params.proxyserver, std::unique_ptr<DhtProxyServer>(new DhtProxyServer(dht, params.proxyserver, params.pushserver)));
#else #else
std::cerr << "DHT proxy server requested but OpenDHT built without proxy server support." << std::endl; std::cerr << "DHT proxy server requested but OpenDHT built without proxy server support." << std::endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment