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.
This commit is contained in:
Vadim Zeitlin
2021-01-11 01:27:38 +01:00
parent 0f82a1e043
commit 397940f5cf

View File

@@ -356,8 +356,8 @@ wxWebSessionCURL::~wxWebSessionCURL()
{
{
// Notify the work thread
m_shuttingDown = true;
wxMutexLocker lock(m_mutex);
m_shuttingDown = true;
m_condition.Signal();
}