mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
fixed race condition
This commit is contained in:
parent
a7421739bc
commit
22773bd678
@ -300,13 +300,15 @@ namespace tunnel
|
||||
{
|
||||
if (pool)
|
||||
{
|
||||
{
|
||||
std::unique_lock<std::mutex> l(m_PoolsMutex);
|
||||
m_Pools.erase (pool->GetIdentHash ());
|
||||
}
|
||||
{
|
||||
std::unique_lock<std::mutex> l(m_PendingTunnelsMutex);
|
||||
for (auto it: m_PendingTunnels)
|
||||
if (it.second->GetTunnelPool () == pool) it.second->SetTunnelPool (nullptr);
|
||||
}
|
||||
std::unique_lock<std::mutex> l(m_PoolsMutex);
|
||||
m_Pools.erase (pool->GetIdentHash ());
|
||||
delete pool;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user