abstract_tcp_server2: fix use after free

pull/70/head
moneromooo-monero 6 years ago committed by wowario
parent 05b49cc1bb
commit 6eaa228b16

@ -652,13 +652,13 @@ PRAGMA_WARNING_DISABLE_VS(4355)
m_timer.cancel(); m_timer.cancel();
boost::system::error_code ignored_ec; boost::system::error_code ignored_ec;
socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ignored_ec); socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ignored_ec);
m_was_shutdown = true;
m_protocol_handler.release_protocol();
if (!m_host.empty()) if (!m_host.empty())
{ {
host_count(m_host, -1); host_count(m_host, -1);
m_host = ""; m_host = "";
} }
m_was_shutdown = true;
m_protocol_handler.release_protocol();
return true; return true;
} }
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------

Loading…
Cancel
Save