From 685aad458c485cd260df694f58d2f7641ce94e32 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 11 Oct 2007 13:29:37 +0000 Subject: 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 --- cpp/src/qpid/broker/Connection.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/broker/Connection.cpp') 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 +#include 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: " << -- cgit v1.2.1