Revert "epee: keep a ref to a connection we're deleting"

This reverts commit f2939bdce8.
This commit is contained in:
moneromooo-monero 2017-12-15 13:23:11 +00:00
parent f51bac990e
commit 64d23ce331
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 2 additions and 8 deletions

View File

@ -743,15 +743,9 @@ void async_protocol_handler_config<t_connection_context>::del_out_connections(si
shuffle(out_connections.begin(), out_connections.end(), std::default_random_engine(seed)); shuffle(out_connections.begin(), out_connections.end(), std::default_random_engine(seed));
while (count > 0 && out_connections.size() > 0) while (count > 0 && out_connections.size() > 0)
{ {
boost::uuids::uuid connection_id = *out_connections.begin(); close(*out_connections.begin());
async_protocol_handler<t_connection_context> *connection = find_connection(connection_id); del_connection(m_connects.at(*out_connections.begin()));
// we temporarily ref the connection so it doesn't drop from the m_connects table
// when we close it
connection->start_outer_call();
close(connection_id);
del_connection(m_connects.at(connection_id));
out_connections.erase(out_connections.begin()); out_connections.erase(out_connections.begin());
connection->finish_outer_call();
--count; --count;
} }