From cb5366c6e3f1e650a6bd600fe69dc23437b48a8f Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 8 Jul 2010 15:40:01 +0000 Subject: Fix cluster-safe assertion in ~Connection. Don't trigger cluster-safe asserts in broker::~Connection as it can be called from an IO threads during broker shutdown. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@961814 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/Connection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cpp') diff --git a/cpp/src/qpid/cluster/Connection.cpp b/cpp/src/qpid/cluster/Connection.cpp index f6cccf06a2..ee296d7f35 100644 --- a/cpp/src/qpid/cluster/Connection.cpp +++ b/cpp/src/qpid/cluster/Connection.cpp @@ -41,6 +41,7 @@ #include "qpid/framing/ConnectionCloseBody.h" #include "qpid/framing/ConnectionCloseOkBody.h" #include "qpid/log/Statement.h" +#include "qpid/sys/ClusterSafe.h" #include "qpid/management/ManagementAgent.h" #include @@ -168,6 +169,11 @@ void Connection::announce( Connection::~Connection() { if (connection.get()) connection->setErrorListener(0); + // Don't trigger cluster-safe asserts in broker:: ~Connection as + // it may be called in an IO thread context during broker + // shutdown. + sys::ClusterSafeScope css; + connection.reset(); } bool Connection::doOutput() { -- cgit v1.2.1