From f5c7bf95dd04dc1cf0248511982a18a45847da14 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 26 Oct 2009 19:23:47 +0000 Subject: Ignore exceptions from detach() in ~SessionImpl. Otherwise clients can crash in terminate() if there is an error, e.g. a TransportFailure. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@829912 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/SessionImpl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/client/SessionImpl.cpp b/cpp/src/qpid/client/SessionImpl.cpp index d443a1170b..b3181bdb3c 100644 --- a/cpp/src/qpid/client/SessionImpl.cpp +++ b/cpp/src/qpid/client/SessionImpl.cpp @@ -76,9 +76,11 @@ SessionImpl::~SessionImpl() { Lock l(state); if (state != DETACHED && state != DETACHING) { QPID_LOG(warning, "Session was not closed cleanly: " << id); - // Inform broker but don't wait for detached as that deadlocks. - // The detached will be ignored as the channel will be invalid. - if (autoDetach) detach(); + try { + // Inform broker but don't wait for detached as that deadlocks. + // The detached will be ignored as the channel will be invalid. + if (autoDetach) detach(); + } catch (...) {} // ignore errors. setState(DETACHED); handleClosed(); state.waitWaiters(); -- cgit v1.2.1