summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-11-19 15:36:16 +0000
committerAlan Conway <aconway@apache.org>2008-11-19 15:36:16 +0000
commite1cc77fda58a22b4d74e19688c0247ce1735ee39 (patch)
treee51e43dc2d1b7d2ea88a1c0fd8eea0baee7576f6
parent27de47471df6ceb5dadd1d24cc00166056c9dbe4 (diff)
downloadqpid-python-e1cc77fda58a22b4d74e19688c0247ce1735ee39.tar.gz
Fix seg fault caused by exceptiosn thrown in Cluster ctor.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@718983 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp2
-rw-r--r--cpp/src/qpidd.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index 5dffae2b2f..d08e06c863 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -113,12 +113,12 @@ Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b, b
}
broker.getKnownBrokers = boost::bind(&Cluster::getUrls, this);
failoverExchange.reset(new FailoverExchange(this));
- broker.addFinalizer(boost::bind(&Cluster::brokerShutdown, this));
cpgDispatchHandle.startWatch(poller);
deliverQueue.start();
QPID_LOG(notice, *this << " joining cluster " << name.str());
if (useQuorum) quorum.init();
cpg.join(name);
+ broker.addFinalizer(boost::bind(&Cluster::brokerShutdown, this)); // Must be last for exception safety.
}
Cluster::~Cluster() {
diff --git a/cpp/src/qpidd.cpp b/cpp/src/qpidd.cpp
index b00a3e63f6..330f12ae83 100644
--- a/cpp/src/qpidd.cpp
+++ b/cpp/src/qpidd.cpp
@@ -23,6 +23,7 @@
#include "qpid/Plugin.h"
#include "qpid/Version.h"
#include "qpid/log/Logger.h"
+#include "qpid/log/Statement.h"
#include "qpid/sys/Shlib.h"
#include <iostream>
@@ -76,7 +77,7 @@ int main(int argc, char* argv[])
return broker.execute(options.get());
}
catch(const exception& e) {
- cerr << e.what() << endl;
+ QPID_LOG(critical, "Broker start-up failed: " << e.what());
}
return 1;
}