From 62daedeae0cf7e979d9a9362a89eeb8093b37dbb Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 9 Apr 2008 20:12:52 +0000 Subject: [PATCH] fixed race condition when a torrent is removed while one of the connections is still in the connection queue --- src/peer_connection.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index cc54adf3e..03d7b7df3 100755 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -2334,7 +2334,13 @@ namespace libtorrent ptime now(time_now()); boost::shared_ptr 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();