diff options
Diffstat (limited to 'contrib/epee')
-rw-r--r-- | contrib/epee/include/net/levin_protocol_handler_async.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/epee/include/net/levin_protocol_handler_async.h b/contrib/epee/include/net/levin_protocol_handler_async.h index 5774c0ba7..1341a4ae6 100644 --- a/contrib/epee/include/net/levin_protocol_handler_async.h +++ b/contrib/epee/include/net/levin_protocol_handler_async.h @@ -949,7 +949,12 @@ bool async_protocol_handler_config<t_connection_context>::close(boost::uuids::uu { CRITICAL_REGION_LOCAL(m_connects_lock); async_protocol_handler<t_connection_context>* aph = find_connection(connection_id); - return 0 != aph ? aph->close() : false; + if (!aph) + return false; + if (!aph->close()) + return false; + m_connects.erase(connection_id); + return true; } //------------------------------------------------------------------------------------------ template<class t_connection_context> |