From f2f4a0b04e6dbee15f8d1e4cda06c9f66633e3c4 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 3 Jul 2014 13:41:36 -0400 Subject: [PATCH] cleanup requested destinations --- NetDb.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NetDb.cpp b/NetDb.cpp index efd12c7c..64e1d250 100644 --- a/NetDb.cpp +++ b/NetDb.cpp @@ -537,6 +537,18 @@ namespace data void NetDb::Explore (int numDestinations) { + // clean up previous exploratories + for (auto it = m_RequestedDestinations.begin (); it != m_RequestedDestinations.end ();) + { + if (it->second->IsExploratory ()) + { + delete it->second; + it = m_RequestedDestinations.erase (it); + } + else + it++; + } + // new requests auto exploratoryPool = i2p::tunnel::tunnels.GetExploratoryPool (); auto outbound = exploratoryPool ? exploratoryPool->GetNextOutboundTunnel () : nullptr; auto inbound = exploratoryPool ? exploratoryPool->GetNextInboundTunnel () : nullptr;