From 1a23d52070195a9c8de98dd4af6e19f42051f1a5 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 29 Mar 2007 22:30:48 +0000 Subject: Fixed memory leak: removed Binding and ExchangeBinding. These classes unbind a deleted queue from any Exchanges. But Exchanges hold shared_ptr, 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 --- cpp/lib/broker/DirectExchange.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'cpp/lib/broker/DirectExchange.cpp') diff --git a/cpp/lib/broker/DirectExchange.cpp b/cpp/lib/broker/DirectExchange.cpp index c898ae8d7e..0661e8c365 100644 --- a/cpp/lib/broker/DirectExchange.cpp +++ b/cpp/lib/broker/DirectExchange.cpp @@ -19,7 +19,6 @@ * */ #include -#include #include using namespace qpid::broker; @@ -30,13 +29,12 @@ DirectExchange::DirectExchange(const string& _name) : Exchange(_name) { } -void DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* args){ +void DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable*){ Mutex::ScopedLock l(lock); std::vector& queues(bindings[routingKey]); std::vector::iterator i = find(queues.begin(), queues.end(), queue); if(i == queues.end()){ bindings[routingKey].push_back(queue); - queue->bound(new ExchangeBinding(this, queue, routingKey, args)); } } -- cgit v1.2.1