fixed possible crash at shutdown

This commit is contained in:
orignal
2024-12-18 14:22:05 -05:00
parent 36939898fe
commit 7497741846
2 changed files with 3 additions and 3 deletions

View File

@@ -1550,6 +1550,7 @@ namespace transport
void NTCP2Server::Stop ()
{
m_EstablisherService.Stop ();
{
// we have to copy it because Terminate changes m_NTCP2Sessions
auto ntcpSessions = m_NTCP2Sessions;
@@ -1565,7 +1566,6 @@ namespace transport
m_TerminationTimer.cancel ();
m_ProxyEndpoint = nullptr;
}
m_EstablisherService.Stop ();
StopIOService ();
}