diff --git a/libi2pd/Transports.cpp b/libi2pd/Transports.cpp index 06bd724d..f3f9e5e4 100644 --- a/libi2pd/Transports.cpp +++ b/libi2pd/Transports.cpp @@ -55,6 +55,13 @@ namespace transport m_Thread->join (); m_Thread = nullptr; } + if (!m_Queue.empty ()) + { + // clean up queue + std::queue > tmp; + std::swap (m_Queue, tmp); + } + m_KeysPool.CleanUpMt (); } template diff --git a/libi2pd/Transports.h b/libi2pd/Transports.h index 85330162..c1acbb2e 100644 --- a/libi2pd/Transports.h +++ b/libi2pd/Transports.h @@ -54,8 +54,8 @@ namespace transport private: const int m_QueueSize; - std::queue > m_Queue; i2p::util::MemoryPoolMt m_KeysPool; + std::queue > m_Queue; bool m_IsRunning; std::unique_ptr m_Thread;