From 5e5aefa2901c338de2af45cb87f031a45fb437f3 Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 27 Nov 2016 10:14:54 -0500 Subject: [PATCH] cleanup leaseset requests on stop --- Destination.cpp | 11 ++++++++--- Garlic.cpp | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Destination.cpp b/Destination.cpp index 66fb4cef..9016c825 100644 --- a/Destination.cpp +++ b/Destination.cpp @@ -85,9 +85,6 @@ namespace client { if (m_IsRunning) Stop (); - for (auto& it: m_LeaseSetRequests) - it.second->Complete (nullptr); - m_LeaseSetRequests.clear (); if (m_Pool) i2p::tunnel::tunnels.DeleteTunnelPool (m_Pool); } @@ -132,6 +129,14 @@ namespace client m_CleanupTimer.cancel (); m_PublishConfirmationTimer.cancel (); m_PublishVerificationTimer.cancel (); + + for (auto& it: m_LeaseSetRequests) + { + it.second->Complete (nullptr); + it.second->requestTimeoutTimer.cancel (); + } + m_LeaseSetRequests.clear (); + m_IsRunning = false; if (m_Pool) { diff --git a/Garlic.cpp b/Garlic.cpp index 306ac816..a11d89a0 100644 --- a/Garlic.cpp +++ b/Garlic.cpp @@ -392,6 +392,10 @@ namespace garlic GarlicDestination::~GarlicDestination () { + m_Sessions.clear (); + m_DeliveryStatusSessions.clear (); + m_Tags.clear (); + LogPrint (eLogInfo, "Garlic: destination destoryed"); } void GarlicDestination::AddSessionKey (const uint8_t * key, const uint8_t * tag)