From 550ee85ea3ac31cedec277b3f4af0b24f5385e77 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 8 Oct 2009 18:28:42 +0000 Subject: Cluster shuts down broker via SignalHandler to fix memory errors on exit. The SignalHandler holds a global reference to the broker which needs to be reset otherwise there are problems when the broker by a global destructor. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@823258 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SignalHandler.cpp | 2 ++ cpp/src/qpid/broker/SignalHandler.h | 3 +++ 2 files changed, 5 insertions(+) (limited to 'cpp/src/qpid/broker') diff --git a/cpp/src/qpid/broker/SignalHandler.cpp b/cpp/src/qpid/broker/SignalHandler.cpp index f4a3822554..b565cfd419 100644 --- a/cpp/src/qpid/broker/SignalHandler.cpp +++ b/cpp/src/qpid/broker/SignalHandler.cpp @@ -38,6 +38,8 @@ void SignalHandler::setBroker(const boost::intrusive_ptr& b) { signal(SIGCHLD,SIG_IGN); } +void SignalHandler::shutdown() { shutdownHandler(0); } + void SignalHandler::shutdownHandler(int) { if (broker.get()) { broker->shutdown(); diff --git a/cpp/src/qpid/broker/SignalHandler.h b/cpp/src/qpid/broker/SignalHandler.h index d2cdfae07c..bbe831b61d 100644 --- a/cpp/src/qpid/broker/SignalHandler.h +++ b/cpp/src/qpid/broker/SignalHandler.h @@ -38,6 +38,9 @@ class SignalHandler /** Set the broker to be shutdown on signals */ static void setBroker(const boost::intrusive_ptr& broker); + /** Initiate shut-down of broker */ + static void shutdown(); + private: static void shutdownHandler(int); static boost::intrusive_ptr broker; -- cgit v1.2.1