summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2009-11-03 00:49:30 +0000
committerStephen D. Huston <shuston@apache.org>2009-11-03 00:49:30 +0000
commita1d4ec4615b6cb6c54b1e6473a0cd0e4d4161b43 (patch)
tree9e49c6d60a4411566a506af895e45a5d0d54a41f /qpid/cpp/src
parent25c77547d05ac41830ed1a7aa1cdf1869cccbaa1 (diff)
downloadqpid-python-a1d4ec4615b6cb6c54b1e6473a0cd0e4d4161b43.tar.gz
Erasing an iterator invalidates the iterator; changed the code to not dereference an iterator that was just deleted.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@832233 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/Queue.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/Queue.cpp b/qpid/cpp/src/qpid/broker/Queue.cpp
index b76581c60d..f260482db9 100644
--- a/qpid/cpp/src/qpid/broker/Queue.cpp
+++ b/qpid/cpp/src/qpid/broker/Queue.cpp
@@ -249,8 +249,9 @@ bool Queue::acquireMessageAt(const SequenceNumber& position, QueuedMessage& mess
if (lastValueQueue) {
clearLVQIndex(*i);
}
+ QPID_LOG(debug,
+ "Acquired message at " << i->position << " from " << name);
messages.erase(i);
- QPID_LOG(debug, "Acquired message at " << i->position << " from " << name);
return true;
}
}
@@ -267,8 +268,10 @@ bool Queue::acquire(const QueuedMessage& msg) {
msg.payload.get() == checkLvqReplace(*i).payload.get()) ) {
clearLVQIndex(msg);
+ QPID_LOG(debug,
+ "Match found, acquire succeeded: " <<
+ i->position << " == " << msg.position);
messages.erase(i);
- QPID_LOG(debug, "Match found, acquire succeeded: " << i->position << " == " << msg.position);
return true;
} else {
QPID_LOG(debug, "No match: " << i->position << " != " << msg.position);