mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-23 17:36:37 +02:00
correct NTCP sessions termination
This commit is contained in:
parent
5699b7bae5
commit
81978b214c
1 changed files with 6 additions and 0 deletions
|
@ -803,6 +803,12 @@ namespace transport
|
||||||
|
|
||||||
void NTCPServer::Stop ()
|
void NTCPServer::Stop ()
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
// we have to copy it because Terminate changes m_NTCPSessions
|
||||||
|
auto ntcpSessions = m_NTCPSessions;
|
||||||
|
for (auto& it: ntcpSessions)
|
||||||
|
it.second->Terminate ();
|
||||||
|
}
|
||||||
m_NTCPSessions.clear ();
|
m_NTCPSessions.clear ();
|
||||||
|
|
||||||
if (m_IsRunning)
|
if (m_IsRunning)
|
||||||
|
|
Loading…
Add table
Reference in a new issue