mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
try fixing sam crashyness
This commit is contained in:
7
SAM.cpp
7
SAM.cpp
@@ -778,13 +778,14 @@ namespace client
|
||||
|
||||
void SAMSession::CloseStreams ()
|
||||
{
|
||||
std::vector<std::shared_ptr<SAMSocket> > socks;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_SocketsMutex);
|
||||
for (auto& sock : m_Sockets) {
|
||||
sock->CloseStream();
|
||||
for (const auto& sock : m_Sockets) {
|
||||
socks.push_back(sock);
|
||||
}
|
||||
}
|
||||
// XXX: should this be done inside locked parts?
|
||||
for (auto & sock : socks ) sock->Terminate();
|
||||
m_Sockets.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user