fix leak of peer_class objects (when setting per-torrent rate limits)
This commit is contained in:
parent
85a179de9a
commit
99b19366a9
|
@ -1,6 +1,7 @@
|
|||
|
||||
1.1.5 release
|
||||
|
||||
* fix leak of peer_class objects (when setting per-torrent rate limits)
|
||||
* expose peer_class API to python binding
|
||||
* fix integer overflow in whole_pieces_threshold logic
|
||||
* fix uTP path MTU discovery issue on windows (DF bit was not set correctly)
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace libtorrent
|
|||
{
|
||||
boost::array<peer_class_t, 15>::iterator i = std::find(m_class.begin()
|
||||
, m_class.begin() + m_size, c);
|
||||
int idx = i - m_class.begin();
|
||||
int const idx = i - m_class.begin();
|
||||
if (idx == m_size) return; // not found
|
||||
if (idx < m_size - 1)
|
||||
{
|
||||
|
|
|
@ -1294,7 +1294,7 @@ namespace aux {
|
|||
{
|
||||
TORRENT_ASSERT(is_single_thread());
|
||||
// if you hit this assert, you're deleting a non-existent peer class
|
||||
TORRENT_ASSERT(m_classes.at(cid));
|
||||
TORRENT_ASSERT_PRECOND(m_classes.at(cid));
|
||||
if (m_classes.at(cid) == 0) return;
|
||||
m_classes.decref(cid);
|
||||
}
|
||||
|
@ -1304,7 +1304,7 @@ namespace aux {
|
|||
peer_class_info ret;
|
||||
peer_class* pc = m_classes.at(cid);
|
||||
// if you hit this assert, you're passing in an invalid cid
|
||||
TORRENT_ASSERT(pc);
|
||||
TORRENT_ASSERT_PRECOND(pc);
|
||||
if (pc == 0)
|
||||
{
|
||||
#ifdef TORRENT_DEBUG
|
||||
|
@ -1351,7 +1351,7 @@ namespace aux {
|
|||
{
|
||||
peer_class* pc = m_classes.at(cid);
|
||||
// if you hit this assert, you're passing in an invalid cid
|
||||
TORRENT_ASSERT(pc);
|
||||
TORRENT_ASSERT_PRECOND(pc);
|
||||
if (pc == 0) return;
|
||||
|
||||
pc->set_info(&pci);
|
||||
|
|
|
@ -4995,6 +4995,7 @@ namespace {
|
|||
|
||||
if (m_peer_class > 0)
|
||||
{
|
||||
remove_class(m_ses.peer_classes(), m_peer_class);
|
||||
m_ses.peer_classes().decref(m_peer_class);
|
||||
m_peer_class = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue