summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/Dispatcher.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-03-05 22:05:26 +0000
committerGordon Sim <gsim@apache.org>2009-03-05 22:05:26 +0000
commitb7fb9f5027f2bf8920a6e32c649c4181db405fa9 (patch)
tree924c16680cb36d0ab10b943d9c096ae2ebeaa9a1 /cpp/src/qpid/client/Dispatcher.cpp
parent203cd3edee0e1644f010450cc6037fc55d07b2a9 (diff)
downloadqpid-python-b7fb9f5027f2bf8920a6e32c649c4181db405fa9.tar.gz
QPID-1718: Ensure that cancellation caused by e.g. SubscriptionManager::get() doesn't close dispatch queue.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@750622 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/Dispatcher.cpp')
-rw-r--r--cpp/src/qpid/client/Dispatcher.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/Dispatcher.cpp b/cpp/src/qpid/client/Dispatcher.cpp
index 27cc4184f9..8d8574520a 100644
--- a/cpp/src/qpid/client/Dispatcher.cpp
+++ b/cpp/src/qpid/client/Dispatcher.cpp
@@ -136,8 +136,7 @@ void Dispatcher::listen(const boost::intrusive_ptr<SubscriptionImpl>& subscripti
void Dispatcher::cancel(const std::string& destination) {
ScopedLock<Mutex> l(lock);
- listeners.erase(destination);
- if (autoStop && listeners.empty())
+ if (listeners.erase(destination) && running && autoStop && listeners.empty())
queue->close();
}