summaryrefslogtreecommitdiff
path: root/cpp/lib/broker/HeadersExchange.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-03-29 22:30:48 +0000
committerAlan Conway <aconway@apache.org>2007-03-29 22:30:48 +0000
commit1a23d52070195a9c8de98dd4af6e19f42051f1a5 (patch)
treea7515a61e0a46defc4ef84bea52424c38bdbba0c /cpp/lib/broker/HeadersExchange.cpp
parent45d083f70618d21ae9d138cf0c3d8e44c84f4f93 (diff)
downloadqpid-python-1a23d52070195a9c8de98dd4af6e19f42051f1a5.tar.gz
Fixed memory leak: removed Binding and ExchangeBinding.
These classes unbind a deleted queue from any Exchanges. But Exchanges hold shared_ptr<Queue>, so queues never deleted while the exchange exists. Moreover queue-binding form a shared_ptr cycle causing a leak. Raised QPID-438 for the remaining problem: destroyed queues are never unbound or deleted git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@523857 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/broker/HeadersExchange.cpp')
-rw-r--r--cpp/lib/broker/HeadersExchange.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/cpp/lib/broker/HeadersExchange.cpp b/cpp/lib/broker/HeadersExchange.cpp
index acd344725a..3ef0cc0446 100644
--- a/cpp/lib/broker/HeadersExchange.cpp
+++ b/cpp/lib/broker/HeadersExchange.cpp
@@ -19,7 +19,6 @@
*
*/
#include <HeadersExchange.h>
-#include <ExchangeBinding.h>
#include <Value.h>
#include <QpidError.h>
#include <algorithm>
@@ -43,14 +42,13 @@ namespace {
HeadersExchange::HeadersExchange(const string& _name) : Exchange(_name) { }
-void HeadersExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* args){
+void HeadersExchange::bind(Queue::shared_ptr queue, const string& /*routingKey*/, const FieldTable* args){
Mutex::ScopedLock locker(lock);
std::string what = args->getString("x-match");
if (what != all && what != any) {
THROW_QPID_ERROR(PROTOCOL_ERROR, "Invalid x-match value binding to headers exchange.");
}
bindings.push_back(Binding(*args, queue));
- queue->bound(new ExchangeBinding(this, queue, routingKey, args));
}
void HeadersExchange::unbind(Queue::shared_ptr queue, const string& /*routingKey*/, const FieldTable* args){