From 29a36ef4ffe0dff1f54b5c1f0d10b3149cafd115 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 21:23:48 +0100 Subject: [PATCH] Unlock wxWebSessionCURL mutex before destroying it Mutexes must not be destroyed while locked and thread sanitizer correctly complains about this, so ensure that we do unlock the mutex before the worked thread terminates and the object is destroyed. --- src/common/webrequest_curl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 4ee6980d0f..b00ae82497 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -439,7 +439,8 @@ static CURLMcode wx_curl_multi_wait(CURLM *multi_handle, int timeout_ms, wxThread::ExitCode wxWebSessionCURL::Entry() { - m_mutex.Lock(); + // This mutex will be unlocked only while we're waiting on the condition. + wxMutexLocker lock(m_mutex); int activeRequests = -1; int repeats = 0;