diff options
-rw-r--r-- | qpid/cpp/src/qpid/ha/BrokerReplicator.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp b/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp index 6b88111732..76f7341b4b 100644 --- a/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp +++ b/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp @@ -837,6 +837,13 @@ void BrokerReplicator::autoDeleteCheck(boost::shared_ptr<Exchange> ex) { } } +// Callback function for accumulating exchange candidates +namespace { + void exchangeAccumulatorCallback(vector<boost::shared_ptr<Exchange> >& c, const Exchange::shared_ptr& i) { + c.push_back(i); + } +} + void BrokerReplicator::disconnected() { QPID_LOG(info, logPrefix << "Disconnected"); connection = 0; @@ -844,7 +851,7 @@ void BrokerReplicator::disconnected() { vector<boost::shared_ptr<Exchange> > collect; // Make a copy so we can work outside the ExchangeRegistry lock exchanges.eachExchange( - boost::bind(&vector<boost::shared_ptr<Exchange> >::push_back, ref(collect), _1)); + boost::bind(&exchangeAccumulatorCallback, boost::ref(collect), _1)); for_each(collect.begin(), collect.end(), boost::bind(&BrokerReplicator::autoDeleteCheck, this, _1)); } |