From 7bfa19fd03c2cfc4b59e41aa326b6ea0016e66f9 Mon Sep 17 00:00:00 2001 From: Ken Giusti Date: Tue, 3 May 2011 22:13:52 +0000 Subject: QPID-3244: C++ broker should release flow control for a queue when it is deleted. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1099283 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/QueueFlowLimit.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cpp/src/qpid/broker/QueueFlowLimit.cpp') diff --git a/cpp/src/qpid/broker/QueueFlowLimit.cpp b/cpp/src/qpid/broker/QueueFlowLimit.cpp index 9f1d3b65f8..b2e2e54bdf 100644 --- a/cpp/src/qpid/broker/QueueFlowLimit.cpp +++ b/cpp/src/qpid/broker/QueueFlowLimit.cpp @@ -120,6 +120,21 @@ QueueFlowLimit::QueueFlowLimit(Queue *_queue, } +QueueFlowLimit::~QueueFlowLimit() +{ + sys::Mutex::ScopedLock l(indexLock); + if (!index.empty()) { + // we're gone - release all pending msgs + for (std::map >::iterator itr = index.begin(); + itr != index.end(); ++itr) + if (itr->second) + try { + itr->second->getIngressCompletion().finishCompleter(); + } catch (...) {} // ignore - not safe for a destructor to throw. + index.clear(); + } +} + void QueueFlowLimit::enqueued(const QueuedMessage& msg) { -- cgit v1.2.1