summaryrefslogtreecommitdiff
path: root/cpp/broker/src/ExchangeRegistry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/broker/src/ExchangeRegistry.cpp')
-rw-r--r--cpp/broker/src/ExchangeRegistry.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/cpp/broker/src/ExchangeRegistry.cpp b/cpp/broker/src/ExchangeRegistry.cpp
index 0ee581af2f..05396382a7 100644
--- a/cpp/broker/src/ExchangeRegistry.cpp
+++ b/cpp/broker/src/ExchangeRegistry.cpp
@@ -24,6 +24,10 @@ using namespace qpid::concurrent;
ExchangeRegistry::ExchangeRegistry() : lock(new MonitorImpl()){}
ExchangeRegistry::~ExchangeRegistry(){
+ for (ExchangeMap::iterator i = exchanges.begin(); i != exchanges.end(); ++i)
+ {
+ delete i->second;
+ }
delete lock;
}
@@ -41,3 +45,13 @@ void ExchangeRegistry::destroy(const string& name){
Exchange* ExchangeRegistry::get(const string& name){
return exchanges[name];
}
+
+namespace
+{
+const std::string empty;
+}
+
+Exchange* ExchangeRegistry::getDefault()
+{
+ return get(empty);
+}