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
parent a702c4e01e
commit 716c54217a

View File

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