diff --git a/Destination.cpp b/Destination.cpp index 91f2a2bb..80951dc4 100644 --- a/Destination.cpp +++ b/Destination.cpp @@ -150,6 +150,7 @@ namespace client delete m_Thread; m_Thread = 0; } + CleanUp (); // GarlicDestination return true; } else diff --git a/Garlic.cpp b/Garlic.cpp index 306ac816..ab20ac8f 100644 --- a/Garlic.cpp +++ b/Garlic.cpp @@ -394,6 +394,12 @@ namespace garlic { } + void GarlicDestination::CleanUp () + { + m_Sessions.clear (); + m_DeliveryStatusSessions.clear (); + m_Tags.clear (); + } void GarlicDestination::AddSessionKey (const uint8_t * key, const uint8_t * tag) { if (key) diff --git a/Garlic.h b/Garlic.h index 010338cd..a7e2d264 100644 --- a/Garlic.h +++ b/Garlic.h @@ -156,6 +156,7 @@ namespace garlic GarlicDestination (): m_NumTags (32) {}; // 32 tags by default ~GarlicDestination (); + void CleanUp (); void SetNumTags (int numTags) { m_NumTags = numTags; }; std::shared_ptr GetRoutingSession (std::shared_ptr destination, bool attachLeaseSet); void CleanupExpiredTags ();