From 9295d5d321ac40a7c2c330af7ca3598d8d039d4c Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 16 Aug 2007 07:46:18 +0000 Subject: Bug fix for client shutdown. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@566527 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/ClientChannel.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'cpp') diff --git a/cpp/src/qpid/client/ClientChannel.cpp b/cpp/src/qpid/client/ClientChannel.cpp index 3cf0373b7f..b36fc82b21 100644 --- a/cpp/src/qpid/client/ClientChannel.cpp +++ b/cpp/src/qpid/client/ClientChannel.cpp @@ -137,21 +137,6 @@ void Channel::rollback(){ session->txRollback(); } -void Channel::close() -{ - session->close(); - { - Mutex::ScopedLock l(lock); - if (connection); - { - session.reset(); - sessionCore.reset(); - connection.reset(); - } - } - stop(); -} - void Channel::consume( Queue& queue, const std::string& tag, MessageListener* listener, AckMode ackMode, bool noLocal, bool synch, const FieldTable* fields) { @@ -211,6 +196,20 @@ void Channel::publish(const Message& msg, const Exchange& exchange, session->basicPublish(0, e, key, mandatory, immediate, msg); } +void Channel::close() +{ + session->close(); + { + Mutex::ScopedLock l(lock); + if (connection); + { + sessionCore.reset(); + connection.reset(); + } + } + stop(); +} + void Channel::start(){ running = true; dispatcher = Thread(*this); -- cgit v1.2.1