mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-06 01:18:17 +00:00
Merge pull request #2544 from pobregat0/datagram-cleanup-lock
Check datagram sessions for empty under the lock
This commit is contained in:
@@ -488,10 +488,10 @@ namespace datagram
|
||||
|
||||
void DatagramDestination::CleanUp ()
|
||||
{
|
||||
if (m_Sessions.empty ()) return;
|
||||
auto now = i2p::util::GetMillisecondsSinceEpoch();
|
||||
LogPrint(eLogDebug, "DatagramDestination: clean up sessions");
|
||||
std::unique_lock<std::mutex> lock(m_SessionsMutex);
|
||||
if (m_Sessions.empty ()) return;
|
||||
LogPrint(eLogDebug, "DatagramDestination: clean up sessions");
|
||||
// for each session ...
|
||||
for (auto it = m_Sessions.begin (); it != m_Sessions.end (); )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user