diff --git a/Transports.cpp b/Transports.cpp index 1659eeed..5b188a7d 100644 --- a/Transports.cpp +++ b/Transports.cpp @@ -101,8 +101,9 @@ namespace transport void DHKeysPairSupplier::Return (std::shared_ptr pair) { - std::unique_lock l(m_AcquiredMutex); - m_Queue.push (pair); + std::unique_lockl(m_AcquiredMutex); + if ((int)m_Queue.size () < 2*m_QueueSize) + m_Queue.push (pair); } Transports transports;