summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2016-04-21 22:25:35 +0000
committerGordon Sim <gsim@apache.org>2016-04-21 22:25:35 +0000
commitc1370cebea3c565bb87bd8119b902703680a71a7 (patch)
treea47c2f1bf9fe0f703ef5d8d272351acf10ce685b
parent12b8481e9a306b3adebc01abb0033913f07450c3 (diff)
downloadqpid-python-c1370cebea3c565bb87bd8119b902703680a71a7.tar.gz
QPID-7225: ensure message to be released is acquired
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1740422 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/broker/IndexedDeque.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/broker/IndexedDeque.h b/qpid/cpp/src/qpid/broker/IndexedDeque.h
index 229b4e3009..e13a218ad0 100644
--- a/qpid/cpp/src/qpid/broker/IndexedDeque.h
+++ b/qpid/cpp/src/qpid/broker/IndexedDeque.h
@@ -112,7 +112,7 @@ template <typename T> class IndexedDeque
T* release(const QueueCursor& cursor)
{
size_t i;
- if (cursor.valid && index(cursor.position, i)) {
+ if (cursor.valid && index(cursor.position, i) && messages[i].getState() == ACQUIRED) {
messages[i].setState(AVAILABLE);
++version;
QPID_LOG(debug, "Released message at position " << cursor.position << ", index " << i);