disconnect all fix

This commit is contained in:
Arvid Norberg 2008-01-17 20:03:59 +00:00
parent 127d3e6ad5
commit 4b3ba58ad2
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}
}