diff options
| author | Alan Conway <aconway@apache.org> | 2012-07-04 19:04:38 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-07-04 19:04:38 +0000 |
| commit | 179f46270e539569e7c57e763ccd8a49ccf09a84 (patch) | |
| tree | 81699bf99bf1ae48672313ebbcaca8a69c4160c4 /qpid/cpp/src | |
| parent | 2235c8c39e252f804ba5c79540147d70b8f2d856 (diff) | |
| download | qpid-python-179f46270e539569e7c57e763ccd8a49ccf09a84.tar.gz | |
NO-JIRA: Trivial fix for crash-on-exit bug.
Primary::~Primary() no longer resets HaBroker::observer. It is unnecessary since
HaBroker unregisters the observer before Primary is destroyed, and it cause
sporadic crash on exit because the HaBroker::observer can be reset before
~Primary is called.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1357370 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/ha/HaBroker.cpp | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/ha/HaBroker.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/ha/Primary.cpp | 1 |
3 files changed, 2 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/ha/HaBroker.cpp b/qpid/cpp/src/qpid/ha/HaBroker.cpp index 395a3ce6fa..6cd78cab20 100644 --- a/qpid/cpp/src/qpid/ha/HaBroker.cpp +++ b/qpid/cpp/src/qpid/ha/HaBroker.cpp @@ -60,9 +60,9 @@ HaBroker::HaBroker(broker::Broker& b, const Settings& s) broker(b), systemId(broker.getSystem()->getSystemId().data()), settings(s), + observer(new ConnectionObserver(*this, systemId)), mgmtObject(0), status(STANDALONE), - observer(new ConnectionObserver(*this, systemId)), brokerInfo(broker.getSystem()->getNodeName(), // TODO aconway 2012-05-24: other transports? broker.getPort(broker::Broker::TCP_TRANSPORT), systemId), diff --git a/qpid/cpp/src/qpid/ha/HaBroker.h b/qpid/cpp/src/qpid/ha/HaBroker.h index 28fe3c755e..78433cfbd9 100644 --- a/qpid/cpp/src/qpid/ha/HaBroker.h +++ b/qpid/cpp/src/qpid/ha/HaBroker.h @@ -116,13 +116,13 @@ class HaBroker : public management::Manageable const Settings settings; mutable sys::Mutex lock; + boost::shared_ptr<ConnectionObserver> observer; // Used by Backup and Primary std::auto_ptr<Backup> backup; std::auto_ptr<Primary> primary; qmf::org::apache::qpid::ha::HaBroker* mgmtObject; Url clientUrl, brokerUrl; std::vector<Url> knownBrokers; BrokerStatus status; - boost::shared_ptr<ConnectionObserver> observer; BrokerInfo brokerInfo; Membership membership; ReplicationTest replicationTest; diff --git a/qpid/cpp/src/qpid/ha/Primary.cpp b/qpid/cpp/src/qpid/ha/Primary.cpp index b315142e70..5eb6b292f7 100644 --- a/qpid/cpp/src/qpid/ha/Primary.cpp +++ b/qpid/cpp/src/qpid/ha/Primary.cpp @@ -97,7 +97,6 @@ Primary::Primary(HaBroker& hb, const BrokerInfo::Set& expect) : } Primary::~Primary() { - haBroker.getObserver()->setObserver(boost::shared_ptr<broker::ConnectionObserver>()); haBroker.getBroker().getConfigurationObservers().remove(configurationObserver); } |
