From 397940f5cf1c25f38ba4fb820093fb1a072f3b37 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 01:27:38 +0100 Subject: [PATCH] Set shut down flag after acquiring the mutex, not before As this flag is tested in the worker thread only when it owns the mutex, set it only after acquiring the mutex too to avoid any possibility of a data race. --- src/common/webrequest_curl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/webrequest_curl.cpp b/src/common/webrequest_curl.cpp index 16527faf2f..5a6208c6f9 100644 --- a/src/common/webrequest_curl.cpp +++ b/src/common/webrequest_curl.cpp @@ -356,8 +356,8 @@ wxWebSessionCURL::~wxWebSessionCURL() { { // Notify the work thread - m_shuttingDown = true; wxMutexLocker lock(m_mutex); + m_shuttingDown = true; m_condition.Signal(); }