summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/posix/QpiddBroker.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-07-01 13:47:11 +0000
committerAlan Conway <aconway@apache.org>2010-07-01 13:47:11 +0000
commit62793fa314f2e3821f7035b74087793867e3d71a (patch)
treebcc90ef62c9ccddea782d24126609eb67c16d116 /qpid/cpp/src/posix/QpiddBroker.cpp
parentfa2ed0433c91a141ababb2c219b4183ac4dc27f8 (diff)
downloadqpid-python-62793fa314f2e3821f7035b74087793867e3d71a.tar.gz
Ensure broker is deleted in main thread, not by global destructors.
Fixes core dumps during shutdown. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@959661 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/posix/QpiddBroker.cpp')
-rw-r--r--qpid/cpp/src/posix/QpiddBroker.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/qpid/cpp/src/posix/QpiddBroker.cpp b/qpid/cpp/src/posix/QpiddBroker.cpp
index 7eef187ded..b340e3e52b 100644
--- a/qpid/cpp/src/posix/QpiddBroker.cpp
+++ b/qpid/cpp/src/posix/QpiddBroker.cpp
@@ -128,6 +128,7 @@ struct QpiddDaemon : public Daemon {
uint16_t port=brokerPtr->getPort(options->daemon.transport);
ready(port); // Notify parent.
brokerPtr->run();
+ broker::SignalHandler::setBroker(0); // Delete broker in this thread.
}
};
@@ -174,6 +175,7 @@ int QpiddBroker::execute (QpiddOptions *options) {
if (options->broker.port == 0 || myOptions->daemon.transport != TCP)
cout << uint16_t(brokerPtr->getPort(myOptions->daemon.transport)) << endl;
brokerPtr->run();
+ broker::SignalHandler::setBroker(0); // Delete broker in this thread.
}
return 0;
}