diff options
Diffstat (limited to 'http_server.h')
-rw-r--r-- | http_server.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/http_server.h b/http_server.h index 6cf8f4f..9381fdb 100644 --- a/http_server.h +++ b/http_server.h @@ -4,6 +4,8 @@ #include <cstdint> #include <atomic> +#include <memory> + #include "http_connection.h" #include "datetime.h" #include "logging.h" @@ -57,7 +59,10 @@ namespace crow [this](boost::system::error_code ec) { if (!ec) - (new Connection<Handler>(std::move(socket_), handler_, server_name_))->start(); + { + auto p = std::make_shared<Connection<Handler>>(std::move(socket_), handler_, server_name_); + p->start(); + } do_accept(); }); } |