forked from premiere/premiere-libtorrent
back-port shutdown assert fix
This commit is contained in:
parent
290ce566b0
commit
a15388df5f
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue