WiimoteReal: Fix Dolphin shutdown crash

Clear m_scan_thread_running later to avoid accessing m_backends after it
has been cleared.
This commit is contained in:
Dentomologist 2021-07-23 17:12:06 -07:00
parent d1beb9ef70
commit cb127509e1
1 changed files with 2 additions and 1 deletions

View File

@ -547,7 +547,7 @@ void WiimoteScanner::StartThread()
void WiimoteScanner::StopThread()
{
if (m_scan_thread_running.TestAndClear())
if (m_scan_thread_running.IsSet())
{
SetScanMode(WiimoteScanMode::DO_NOT_SCAN);
@ -556,6 +556,7 @@ void WiimoteScanner::StopThread()
backend->RequestStopSearching();
}
m_scan_thread_running.Clear();
m_scan_thread.join();
}
}