summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/QueueFlowLimit.cpp
diff options
context:
space:
mode:
authorKen Giusti <kgiusti@apache.org>2011-05-03 22:13:52 +0000
committerKen Giusti <kgiusti@apache.org>2011-05-03 22:13:52 +0000
commit7bfa19fd03c2cfc4b59e41aa326b6ea0016e66f9 (patch)
tree7e17c67c12fd7f17cd3a2c5dda7b6b3f42e58ad2 /cpp/src/qpid/broker/QueueFlowLimit.cpp
parentd7cf0860fe89d313517ba648bd7ef87d75ac6ec6 (diff)
downloadqpid-python-7bfa19fd03c2cfc4b59e41aa326b6ea0016e66f9.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/broker/QueueFlowLimit.cpp')
-rw-r--r--cpp/src/qpid/broker/QueueFlowLimit.cpp15
1 files changed, 15 insertions, 0 deletions
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<framing::SequenceNumber, boost::intrusive_ptr<Message> >::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)
{