Properly handle g_wiimotes_mutex again for reconnect on button press for real wiimotes

Sorry, i overlooked the mutex in PR  https://github.com/dolphin-emu/dolphin/pull/4949

This pr fixes issue 10434: https://bugs.dolphin-emu.org/issues/10434
This commit is contained in:
mimimi085181 2017-08-03 01:49:47 +02:00
parent d0bcdc7f89
commit 576bf32ab2
1 changed files with 4 additions and 2 deletions

View File

@ -892,11 +892,13 @@ bool CheckForButtonPress(int wiimote_number)
if (!g_wiimotes_mutex.try_lock())
return false;
bool button_pressed = false;
if (g_wiimotes[wiimote_number])
return g_wiimotes[wiimote_number]->CheckForButtonPress();
button_pressed = g_wiimotes[wiimote_number]->CheckForButtonPress();
g_wiimotes_mutex.unlock();
return false;
return button_pressed;
}
bool IsValidDeviceName(const std::string& name)