forked from premiere/premiere-libtorrent
minor fix to broadcast socket patch
This commit is contained in:
parent
0a2b352795
commit
da4998bd46
|
@ -392,7 +392,13 @@ namespace libtorrent
|
||||||
bool broadcast_socket::maybe_abort()
|
bool broadcast_socket::maybe_abort()
|
||||||
{
|
{
|
||||||
if (m_abort && m_outstanding_operations == 0)
|
if (m_abort && m_outstanding_operations == 0)
|
||||||
m_on_receive.clear();
|
{
|
||||||
|
// it's important that m_on_receive is cleared
|
||||||
|
// before the object is destructed, since it may
|
||||||
|
// hold a reference to ourself, which would otherwise
|
||||||
|
// cause an infinite recursion destructing the objects
|
||||||
|
receive_handler_t().swap(m_on_receive);
|
||||||
|
}
|
||||||
return m_abort;
|
return m_abort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue