back-port torrent peer-class fix from master

This commit is contained in:
arvidn 2016-05-07 14:56:22 -04:00
parent 6d49d9d061
commit 254906eddc
3 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,6 @@
1.1.1 release
* fixed peer-class leak when settings per-torrent rate limits
* added a new "preformatted" type to bencode entry variant type
* improved Socks5 support and test coverage
* fix set_settings in python binding

@ -1 +1 @@
Subproject commit ea3bffe3c53bca5e0976914ea951193ba43fbed6
Subproject commit ad23c932ecd852f89c7d8b29dfe162e9ee073a1b

View File

@ -970,6 +970,7 @@ namespace libtorrent
// this means that the invariant check that this is called from the
// network thread cannot be maintained
TORRENT_ASSERT(m_peer_class == 0);
TORRENT_ASSERT(m_abort);
TORRENT_ASSERT(m_connections.empty());
if (!m_connections.empty())
@ -4936,6 +4937,12 @@ namespace libtorrent
update_gauge();
stop_announcing();
if (m_peer_class > 0)
{
m_ses.peer_classes().decref(m_peer_class);
m_peer_class = 0;
}
error_code ec;
m_inactivity_timer.cancel(ec);