summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/Connection.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-10-17 08:59:44 +0000
committerGordon Sim <gsim@apache.org>2007-10-17 08:59:44 +0000
commitc619794e8a903e716bc5117179ea0ab1e24e1254 (patch)
treee4cf22d8de792053a4bb7b594b0e1cc2b2ca8abc /cpp/src/qpid/broker/Connection.cpp
parentde86223091817b091b8f49774853d927c00eed9b (diff)
downloadqpid-python-c619794e8a903e716bc5117179ea0ab1e24e1254.tar.gz
Use shared pointers for consumers (held by queues and sessions) to prevent having to hold lock across deliver() while avoiding invocation on stale pointers.
Ensure auto-deleted queues are properly cleaned up (i.e. are unbound from exchanges) to avoid leaking memory as messages are accumulated in inaccessible queues. (some cleanup to follow on this) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@585417 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Connection.cpp')
-rw-r--r--cpp/src/qpid/broker/Connection.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp
index 21d759c901..ca0ca20849 100644
--- a/cpp/src/qpid/broker/Connection.cpp
+++ b/cpp/src/qpid/broker/Connection.cpp
@@ -78,11 +78,8 @@ void Connection::closed(){
while (!exclusiveQueues.empty()) {
Queue::shared_ptr q(exclusiveQueues.front());
q->releaseExclusiveOwnership();
- if (q->canAutoDelete() &&
- broker.getQueues().destroyIf(q->getName(), boost::bind(boost::mem_fn(&Queue::canAutoDelete), q))) {
-
- q->unbind(broker.getExchanges(), q);
- q->destroy();
+ if (q->canAutoDelete()) {
+ Queue::tryAutoDelete(broker, q);
}
exclusiveQueues.erase(exclusiveQueues.begin());
}