fixed race condition when a torrent is removed while one of the connections is still in the connection queue

This commit is contained in:
Arvid Norberg 2008-04-09 20:12:52 +00:00
parent 291ef2a2c9
commit 62daedeae0
1 changed files with 7 additions and 1 deletions

View File

@ -2334,7 +2334,13 @@ namespace libtorrent
ptime now(time_now());
boost::shared_ptr<torrent> t = m_torrent.lock();
TORRENT_ASSERT(t);
if (!t || m_disconnecting)
{
m_ses.m_half_open.done(m_connection_ticket);
m_connecting = false;
disconnect();
return;
}
on_tick();