From 81978b214c111a030a658468c403ea60129300db Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 30 Nov 2016 09:24:49 -0500 Subject: [PATCH] correct NTCP sessions termination --- NTCPSession.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NTCPSession.cpp b/NTCPSession.cpp index a9e13fc5..73cd1828 100644 --- a/NTCPSession.cpp +++ b/NTCPSession.cpp @@ -803,6 +803,12 @@ namespace transport 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 (); if (m_IsRunning)