From e7f82f3d5b39c77ee913ee4cd6b4bf1bdc8b13bc Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 3 Jul 2007 09:04:00 +0000 Subject: Autodeletable shared queues are now deleted as soon as the consumer count drops to zero (i.e. there is no timeout). This closes QPID-533. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@552751 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/BrokerChannel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cpp/src/qpid/broker/BrokerChannel.cpp') diff --git a/cpp/src/qpid/broker/BrokerChannel.cpp b/cpp/src/qpid/broker/BrokerChannel.cpp index 26e590f87e..f6a50a7ef5 100644 --- a/cpp/src/qpid/broker/BrokerChannel.cpp +++ b/cpp/src/qpid/broker/BrokerChannel.cpp @@ -249,8 +249,13 @@ Channel::ConsumerImpl::~ConsumerImpl() { } void Channel::ConsumerImpl::cancel(){ - if(queue) + if(queue) { queue->cancel(this); + if (queue->canAutoDelete()) { + parent->connection.broker.getQueues().destroyIf(queue->getName(), + boost::bind(boost::mem_fn(&Queue::canAutoDelete), queue)); + } + } } void Channel::ConsumerImpl::requestDispatch(){ -- cgit v1.2.1