diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/client/SessionImpl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cpp/src/qpid/client/SessionImpl.cpp b/cpp/src/qpid/client/SessionImpl.cpp index 34589d59fc..05d90b4314 100644 --- a/cpp/src/qpid/client/SessionImpl.cpp +++ b/cpp/src/qpid/client/SessionImpl.cpp @@ -73,12 +73,12 @@ SessionImpl::~SessionImpl() { { Lock l(state); if (state != DETACHED && state != DETACHING) { - QPID_LOG(warning, "Session was not closed cleanly: " << id); - try { + if (autoDetach) { + 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(); - } catch (...) {} // ignore errors. + try { detach(); } catch (...) {} // ignore errors. + } setState(DETACHED); handleClosed(); state.waitWaiters(); |