WiimoteReal: Make sure that Wiimote thread isn't already running before starting it.

This fixes a crash when switching a Wiimote's internal slot or type in the Dolphin config.
This commit is contained in:
Admiral H. Curtiss 2015-06-21 14:22:07 +02:00 committed by Jules Blok
parent 384a1b4e3b
commit 69b7296fc2
1 changed files with 6 additions and 3 deletions

View File

@ -485,9 +485,12 @@ void WiimoteScanner::ThreadFunc()
bool Wiimote::Connect()
{
m_thread_ready.store(false);
StartThread();
WaitReady();
if (!m_run_thread.load())
{
m_thread_ready.store(false);
StartThread();
WaitReady();
}
return IsConnected();
}