From 5dd685cef956596f27d91865b2f6b2fb1e8bfcc7 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 29 Mar 2016 13:49:38 +0200 Subject: [PATCH] Fix socket exceptions while querying the API fixes #11224 --- lib/base/tlsstream.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp index f1248eee7..93a7501a5 100644 --- a/lib/base/tlsstream.cpp +++ b/lib/base/tlsstream.cpp @@ -245,7 +245,9 @@ void TlsStream::OnEvent(int revents) } if (m_Shutdown && !m_SendQ->IsDataAvailable()) { - lock.unlock(); + if (!success) + lock.unlock(); + Close(); } } -- 2.40.0