summaryrefslogtreecommitdiff
path: root/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
commitae3b13c693bab1a66d4a5d72873869fd128e32a3 (patch)
tree50c7e6ba64144f222028629e5fbc3110028cd726 /cpp/src
parent605270366b23ef1274abafe13699a66e1a28192c (diff)
downloadqpid-python-ae3b13c693bab1a66d4a5d72873869fd128e32a3.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/qpid@832233 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/broker/Queue.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp
index b76581c60d..f260482db9 100644
--- a/cpp/src/qpid/broker/Queue.cpp
+++ b/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);