Author: shuston
Date: Tue Nov 3 00:49:30 2009
New Revision: 832233
URL: http://svn.apache.org/viewvc?rev=832233&view=rev
Log:
Erasing an iterator invalidates the iterator; changed the code to not
dereference an iterator that was just deleted.
Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=832233&r1=832232&r2=832233&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Tue Nov 3 00:49:30 2009
@@ -249,8 +249,9 @@
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 @@
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);
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]