1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-19 01:09:58 +00:00

fixed potential deadlock

This commit is contained in:
orignal 2024-01-30 10:04:19 -05:00
parent f008478505
commit 85f5f5b91e

View File

@ -85,18 +85,14 @@ namespace transport
isReachable = (bool)router->GetCompatibleTransports (true); isReachable = (bool)router->GetCompatibleTransports (true);
} }
} }
~Peer ()
{
// drop not sent delayed messages
for (auto& it: delayedMessages)
it->Drop ();
}
void Done () void Done ()
{ {
for (auto& it: sessions) for (auto& it: sessions)
it->Done (); it->Done ();
// drop not sent delayed messages
for (auto& it: delayedMessages)
it->Drop ();
} }
void SetRouter (std::shared_ptr<const i2p::data::RouterInfo> r) void SetRouter (std::shared_ptr<const i2p::data::RouterInfo> r)