summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-07-01 19:23:43 +0000
committerAlan Conway <aconway@apache.org>2010-07-01 19:23:43 +0000
commit368ccad5d09ad151dbf866c2bc49a57e457a6405 (patch)
tree65deee9db7b76ad0c060bb2cee13c1808952b8bf /qpid/cpp/src
parent61847068238af35543de06e54bc757dbfb3da776 (diff)
downloadqpid-python-368ccad5d09ad151dbf866c2bc49a57e457a6405.tar.gz
Fix sporadic cluster core on exit.
Fix a race condition that allows a cluster::Connection to be deleted via the Cluster's local map before it was fully initialized. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@959752 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/cluster/Connection.cpp1
-rw-r--r--qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp1
2 files changed, 1 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/cluster/Connection.cpp b/qpid/cpp/src/qpid/cluster/Connection.cpp
index d4f0a06eaf..f6cccf06a2 100644
--- a/qpid/cpp/src/qpid/cluster/Connection.cpp
+++ b/qpid/cpp/src/qpid/cluster/Connection.cpp
@@ -95,7 +95,6 @@ Connection::Connection(Cluster& c, sys::ConnectionOutputHandler& out,
updateIn(c.getUpdateReceiver()),
secureConnection(0)
{
- cluster.addLocalConnection(this);
if (isLocalClient()) {
giveReadCredit(cluster.getSettings().readMax); // Flow control
// Delay adding the connection to the management map until announce()
diff --git a/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp b/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp
index 931cda4893..91ec10903c 100644
--- a/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp
+++ b/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp
@@ -58,6 +58,7 @@ ConnectionCodec::ConnectionCodec(
) : codec(out, logId, isLink),
interceptor(new Connection(cluster, codec, logId, cluster.getId(), catchUp, isLink, external))
{
+ cluster.addLocalConnection(interceptor);
std::auto_ptr<sys::ConnectionInputHandler> ih(new ProxyInputHandler(interceptor));
codec.setInputHandler(ih);
codec.setVersion(v);