summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/BrokerChannel.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-07-03 09:04:00 +0000
committerGordon Sim <gsim@apache.org>2007-07-03 09:04:00 +0000
commite7f82f3d5b39c77ee913ee4cd6b4bf1bdc8b13bc (patch)
tree287e8ce31be4594915c577045025b466d969d17b /cpp/src/qpid/broker/BrokerChannel.cpp
parent953eb74e69055777252ec05e1c277ec32fed82d0 (diff)
downloadqpid-python-e7f82f3d5b39c77ee913ee4cd6b4bf1bdc8b13bc.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/broker/BrokerChannel.cpp')
-rw-r--r--cpp/src/qpid/broker/BrokerChannel.cpp7
1 files changed, 6 insertions, 1 deletions
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(){