close ntcp sessions to prevent memory leaks

This commit is contained in:
Jeff Becker 2016-06-19 16:48:03 -04:00
parent 1c024afc1b
commit 184c6ee252

View File

@ -457,7 +457,12 @@ namespace transport
m_SSUServer->DeleteSession (ssuSession);
LogPrint (eLogDebug, "Transports: SSU session closed");
}
// TODO: delete NTCP
auto ntcpSession = m_NTCPServer ? m_NTCPServer->FindNTCPSession(router->GetIdentHash()) : nullptr;
if (ntcpSession) // try deleting ntcp session too
{
m_NTCPServer->RemoveNTCPSession(ntcpSession);
LogPrint(eLogDebug, "Transports: NTCP session closed");
}
}
void Transports::DetectExternalIP ()