From 6fa6fd99a004c98533f533dc52933c3cbc3c2674 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 30 Oct 2009 20:33:46 +0000 Subject: Fix memory leak in testCoincidentErrors due to un-joined connector thread. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@831446 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/ConnectionImpl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid') diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp index e4e7b2f5c2..4f35639c71 100644 --- a/cpp/src/qpid/client/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/ConnectionImpl.cpp @@ -156,8 +156,14 @@ void ConnectionImpl::open() handler.setRcvTimeoutTask(heartbeatTask); theTimer().add(heartbeatTask); } - - handler.waitForOpen(); + + try { + handler.waitForOpen(); + } catch (...) { + // Make sure the connector thread is joined. + connector->close(); + throw; + } // If the SASL layer has provided an "operational" userId for the connection, // put it in the negotiated settings. -- cgit v1.2.1