back-port shutdown assert fix

This commit is contained in:
Arvid Norberg 2014-04-06 01:03:01 +00:00
parent 290ce566b0
commit a15388df5f
1 changed files with 10 additions and 1 deletions

View File

@ -55,8 +55,17 @@ namespace libtorrent
void bandwidth_manager::close() void bandwidth_manager::close()
{ {
m_abort = true; m_abort = true;
m_queue.clear();
queue_t tm;
tm.swap(m_queue);
m_queued_bytes = 0; m_queued_bytes = 0;
while (!tm.empty())
{
bw_request& bwr = tm.back();
bwr.peer->assign_bandwidth(m_channel, bwr.assigned);
tm.pop_back();
}
} }
#if TORRENT_USE_ASSERTS #if TORRENT_USE_ASSERTS