fixed crash on stop

This commit is contained in:
orignal 2020-02-06 10:53:45 -05:00
parent 012f22cc47
commit 63e807b0b4

View file

@ -1042,9 +1042,12 @@ namespace client
LogPrint (eLogError, "SAM: runtime exception: ", ex.what ()); LogPrint (eLogError, "SAM: runtime exception: ", ex.what ());
} }
for (auto& it: m_Sessions) {
it.second->CloseStreams (); std::unique_lock<std::mutex> l(m_SessionsMutex);
m_Sessions.clear (); for (auto& it: m_Sessions)
it.second->CloseStreams ();
m_Sessions.clear ();
}
StopIOService (); StopIOService ();
} }