From 4b3ba58ad20a62353f8d240abe5be6c401a91715 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 17 Jan 2008 20:03:59 +0000 Subject: [PATCH] disconnect all fix --- src/torrent.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index 57b8fa896..5f0cf61d6 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -2261,7 +2261,10 @@ namespace libtorrent #ifndef NDEBUG std::size_t size = m_connections.size(); #endif - p->disconnect(m_abort?"stopping torrent":"pausing torrent"); + if (p->is_disconnecting()) + m_connections.pop_front(); + else + p->disconnect(m_abort?"stopping torrent":"pausing torrent"); TORRENT_ASSERT(m_connections.size() <= size); } }