From 0d8b3910efdb5651bfe5aa96895e155ae2436ffb Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 3 Jul 2014 19:53:11 -0400 Subject: [PATCH] delete expired transit tunnels --- Tunnel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tunnel.cpp b/Tunnel.cpp index 0c1fe454..b7c2e661 100644 --- a/Tunnel.cpp +++ b/Tunnel.cpp @@ -399,6 +399,7 @@ namespace tunnel if (pool) pool->TunnelExpired (*it); it = m_OutboundTunnels.erase (it); + // TODO: delete tunnel, but make nobody uses it } else it++; @@ -431,6 +432,7 @@ namespace tunnel if (pool) pool->TunnelExpired (it->second); it = m_InboundTunnels.erase (it); + // TODO: delete tunnel, but make nobody uses it } else it++; @@ -465,7 +467,9 @@ namespace tunnel if (ts > it->second->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT) { LogPrint ("Transit tunnel ", it->second->GetTunnelID (), " expired"); + auto tmp = it->second; it = m_TransitTunnels.erase (it); + delete tmp; } else it++;