Fixed crash if server instance gets deleted after the call to io_service->stop() but before the acceptor gets notified of the stop.
This commit is contained in:
parent
8da3ad4dde
commit
743785b563
2 changed files with 7 additions and 4 deletions
|
|
@ -31,8 +31,10 @@ namespace SimpleWeb {
|
|||
std::shared_ptr<HTTPS> socket(new HTTPS(*io_service, context));
|
||||
|
||||
acceptor->async_accept((*socket).lowest_layer(), [this, socket](const boost::system::error_code& ec) {
|
||||
//Immediately start accepting a new connection
|
||||
accept();
|
||||
//Immediately start accepting a new connection (if io_service hasn't been stopped)
|
||||
if (ec != boost::asio::error::operation_aborted)
|
||||
accept();
|
||||
|
||||
|
||||
if(!ec) {
|
||||
boost::asio::ip::tcp::no_delay option(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue