diff options
author | Gordon Sim <gsim@apache.org> | 2007-10-11 13:29:37 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-10-11 13:29:37 +0000 |
commit | 685aad458c485cd260df694f58d2f7641ce94e32 (patch) | |
tree | 57b4963ac7105f711ced6e4627232e0f62fda3be /cpp/src/qpid/broker/Connection.cpp | |
parent | a23f05ddb503e587473519fa3f6491a93798a535 (diff) | |
download | qpid-python-685aad458c485cd260df694f58d2f7641ce94e32.tar.gz |
Exclusive no longer implies auto-delete on queue.declare.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@583821 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Connection.cpp')
-rw-r--r-- | cpp/src/qpid/broker/Connection.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index a21db0f603..21d759c901 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -29,6 +29,7 @@ #include "SemanticHandler.h" #include <boost/utility/in_place_factory.hpp> +#include <boost/bind.hpp> using namespace boost; using namespace qpid::sys; @@ -76,10 +77,14 @@ void Connection::closed(){ try { while (!exclusiveQueues.empty()) { Queue::shared_ptr q(exclusiveQueues.front()); - broker.getQueues().destroy(q->getName()); + 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(); + } exclusiveQueues.erase(exclusiveQueues.begin()); - q->unbind(broker.getExchanges(), q); - q->destroy(); } } catch(std::exception& e) { QPID_LOG(error, " Unhandled exception while closing session: " << |