Author: aconway
Date: Thu Jan 19 23:08:52 2012
New Revision: 1233684
URL: http://svn.apache.org/viewvc?rev=1233684&view=rev
Log:
QPID-3603: Fix QueueReplicator lifecycle, shared pointer cycle.
Modified:
qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/ha/QueueReplicator.cpp
qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/ha/QueueReplicator.h
Modified: qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/ha/QueueReplicator.cpp
URL:
http://svn.apache.org/viewvc/qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/ha/QueueReplicator.cpp?rev=1233684&r1=1233683&r2=1233684&view=diff
==============================================================================
--- qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/ha/QueueReplicator.cpp
(original)
+++ qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/ha/QueueReplicator.cpp Thu Jan
19 23:08:52 2012
@@ -62,9 +62,6 @@ QueueReplicator::QueueReplicator(boost::
// This must be separate from the constructor so we can call shared_from_this.
void QueueReplicator::activate() {
- // Take a reference to myself to ensure not deleted before initializeBridge
- // is called.
- self = shared_from_this();
// Note this may create a new bridge or use an existing one.
queue->getBroker()->getLinks().declare(
link->getHost(), link->getPort(),
@@ -80,7 +77,7 @@ void QueueReplicator::activate() {
0, // sync?
// Include shared_ptr to self to ensure we are not deleted
// before initializeBridge is called.
- boost::bind(&QueueReplicator::initializeBridge, this, _1, _2, self)
+ boost::bind(&QueueReplicator::initializeBridge, this, _1, _2,
shared_from_this())
);
}
Modified: qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/ha/QueueReplicator.h
URL:
http://svn.apache.org/viewvc/qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/ha/QueueReplicator.h?rev=1233684&r1=1233683&r2=1233684&view=diff
==============================================================================
--- qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/ha/QueueReplicator.h (original)
+++ qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/ha/QueueReplicator.h Thu Jan 19
23:08:52 2012
@@ -79,7 +79,6 @@ class QueueReplicator : public broker::E
sys::Mutex lock;
boost::shared_ptr<broker::Queue> queue;
boost::shared_ptr<broker::Link> link;
- boost::shared_ptr<QueueReplicator> self;
};
}} // namespace qpid::ha
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]