summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/Exchange.cpp
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2009-10-22 12:53:10 +0000
committerTed Ross <tross@apache.org>2009-10-22 12:53:10 +0000
commit104e2ee164f8f31230e42e9fdfd5c2f98de31222 (patch)
tree6421985dd0e1f08079656c0f0d297aa3f26c183c /cpp/src/qpid/broker/Exchange.cpp
parentd12750e4646c2ff79e8fd4d37821ccce25582d95 (diff)
downloadqpid-python-104e2ee164f8f31230e42e9fdfd5c2f98de31222.tar.gz
QPID-1732 - When an exchange is deleted, the binding-count for bound queues is not adjusted for deleted bindings.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@828674 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Exchange.cpp')
-rw-r--r--cpp/src/qpid/broker/Exchange.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/Exchange.cpp b/cpp/src/qpid/broker/Exchange.cpp
index 757127eef2..9468ba0b62 100644
--- a/cpp/src/qpid/broker/Exchange.cpp
+++ b/cpp/src/qpid/broker/Exchange.cpp
@@ -306,6 +306,7 @@ Exchange::Binding::Binding(const string& _key, Queue::shared_ptr _queue, Exchang
if (!origin.empty())
mgmtBinding->set_origin(origin);
agent->addObject (mgmtBinding, agent->allocateId(this));
+ static_cast<_qmf::Queue*>(mo)->inc_bindingCount();
}
}
}
@@ -314,8 +315,12 @@ Exchange::Binding::Binding(const string& _key, Queue::shared_ptr _queue, Exchang
Exchange::Binding::~Binding ()
{
- if (mgmtBinding != 0)
+ if (mgmtBinding != 0) {
+ ManagementObject* mo = queue->GetManagementObject();
+ if (mo != 0)
+ static_cast<_qmf::Queue*>(mo)->dec_bindingCount();
mgmtBinding->resourceDestroy ();
+ }
}
ManagementObject* Exchange::Binding::GetManagementObject () const