for Roker: using std::unique_ptr ;-)

pull/1/head
Volker Birk 3 years ago
parent 38698b900d
commit 7c7f53be0d

@ -6,9 +6,10 @@
int main()
{
unsigned short port;
auto web =
pEp::Webserver::probing_port_range(pEp::net::ip::address::from_string("127.0.0.1"),
8080, 8089, port, "htdocs");
std::unique_ptr<pEp::Webserver> web(
pEp::Webserver::probing_port_range(pEp::net::ip::address::from_string("127.0.0.1"),
8080, 8089, port, "htdocs")
);
if (!web) {
std::cerr << "cannot start webserver, no ports free\n";
return 1;
@ -50,7 +51,6 @@ int main()
);
web->run();
delete web;
return 0;
}

Loading…
Cancel
Save