diff options
| author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2011-05-03 22:13:52 +0000 |
|---|---|---|
| committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2011-05-03 22:13:52 +0000 |
| commit | 4e115887da892949d4891df37d62d6ac46b61200 (patch) | |
| tree | 7e17c67c12fd7f17cd3a2c5dda7b6b3f42e58ad2 /cpp | |
| parent | 8655945af14cea757f558bea2ea92496265aa7ca (diff) | |
| download | qpid-python-4e115887da892949d4891df37d62d6ac46b61200.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')
| -rw-r--r-- | cpp/src/qpid/broker/QueueFlowLimit.cpp | 15 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/QueueFlowLimit.h | 2 |
2 files changed, 16 insertions, 1 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) { diff --git a/cpp/src/qpid/broker/QueueFlowLimit.h b/cpp/src/qpid/broker/QueueFlowLimit.h index 5fdae39c29..ded27fb8bb 100644 --- a/cpp/src/qpid/broker/QueueFlowLimit.h +++ b/cpp/src/qpid/broker/QueueFlowLimit.h @@ -78,7 +78,7 @@ class Broker; static QPID_BROKER_EXTERN const std::string flowStopSizeKey; static QPID_BROKER_EXTERN const std::string flowResumeSizeKey; - virtual ~QueueFlowLimit() {} + virtual ~QueueFlowLimit(); /** the queue has added QueuedMessage. Returns true if flow state changes */ QPID_BROKER_EXTERN void enqueued(const QueuedMessage&); |
