From a9cf9a1d43a0025a825176c263172834953c93c0 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 1 Feb 2011 21:25:43 +0000 Subject: QPID-3007: Don't hold on to consumer shared-pointers in UpdateClient::consumerNumbering Holding shared pointers in UpdateClient::consumerNumbering can hold consumers in memory and delete them out of sync with other cluster members. Made it hold plain pointers instead since we don't actually need to ensure object liveness, we're just doing an address/number correspondence. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1066217 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/UpdateClient.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cpp/src/qpid/cluster/UpdateClient.cpp') diff --git a/cpp/src/qpid/cluster/UpdateClient.cpp b/cpp/src/qpid/cluster/UpdateClient.cpp index e5d20c85e6..4f6488a28a 100644 --- a/cpp/src/qpid/cluster/UpdateClient.cpp +++ b/cpp/src/qpid/cluster/UpdateClient.cpp @@ -497,7 +497,7 @@ void UpdateClient::updateConsumer( ci->isNotifyEnabled(), ci->position ); - consumerNumbering.add(ci); + consumerNumbering.add(ci.get()); QPID_LOG(debug, *this << " updated consumer " << ci->getName() << " on " << shadowSession.getId()); @@ -584,10 +584,9 @@ void UpdateClient::updateQueueListeners(const boost::shared_ptr& } void UpdateClient::updateQueueListener(std::string& q, - const boost::shared_ptr& c) + const boost::shared_ptr& c) { - const boost::shared_ptr ci = - boost::dynamic_pointer_cast(c); + SemanticState::ConsumerImpl* ci = dynamic_cast(c.get()); size_t n = consumerNumbering[ci]; if (n >= consumerNumbering.size()) throw Exception(QPID_MSG("Unexpected listener on queue " << q)); -- cgit v1.2.1