From c10ee59de3d5c2b352cab10959a558c612bce9a8 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 21 Jan 2022 21:34:50 -0500 Subject: [PATCH] cleanup memrory pools if no more streams --- libi2pd/Streaming.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libi2pd/Streaming.cpp b/libi2pd/Streaming.cpp index 4967c93d..71b25f1c 100644 --- a/libi2pd/Streaming.cpp +++ b/libi2pd/Streaming.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013-2021, The PurpleI2P Project +* Copyright (c) 2013-2022, The PurpleI2P Project * * This file is part of Purple i2pd project and licensed under BSD3 * @@ -1273,6 +1273,11 @@ namespace stream m_IncomingStreams.erase (stream->GetSendStreamID ()); if (m_LastStream == stream) m_LastStream = nullptr; } + if (m_Streams.empty ()) + { + m_PacketsPool.CleanUp (); + m_I2NPMsgsPool.CleanUp (); + } } bool StreamingDestination::DeleteStream (uint32_t recvStreamID)