mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-10 17:41:06 +00:00
fixed termination deadlock if SAM session is active
This commit is contained in:
parent
1e7254dfaa
commit
4fa5cec0dc
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
* Copyright (c) 2013-2025, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
@ -1350,12 +1350,14 @@ namespace client
|
|||||||
LogPrint (eLogError, "SAM: Runtime exception: ", ex.what ());
|
LogPrint (eLogError, "SAM: Runtime exception: ", ex.what ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
decltype(m_Sessions) sessions;
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_SessionsMutex);
|
std::unique_lock<std::mutex> l(m_SessionsMutex);
|
||||||
for (auto& it: m_Sessions)
|
m_Sessions.swap (sessions);
|
||||||
it.second->Close ();
|
}
|
||||||
m_Sessions.clear ();
|
for (auto& it: sessions)
|
||||||
}
|
it.second->Close ();
|
||||||
|
|
||||||
StopIOService ();
|
StopIOService ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user