mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 15:49:50 -06:00
Don't need to hang dolphin when searching for wiimote with the refresh button.
This code is getting pretty ugly. :/
This commit is contained in:
@ -565,13 +565,15 @@ void Refresh()
|
|||||||
g_wiimote_scanner.StopScanning();
|
g_wiimote_scanner.StopScanning();
|
||||||
|
|
||||||
{
|
{
|
||||||
std::lock_guard<std::recursive_mutex> lk(g_refresh_lock);
|
std::unique_lock<std::recursive_mutex> lk(g_refresh_lock);
|
||||||
|
|
||||||
std::vector<Wiimote*> found_wiimotes;
|
std::vector<Wiimote*> found_wiimotes;
|
||||||
|
|
||||||
if (0 != CalculateWantedWiimotes())
|
if (0 != CalculateWantedWiimotes())
|
||||||
{
|
{
|
||||||
|
// Don't hang dolphin when searching
|
||||||
|
lk.unlock();
|
||||||
found_wiimotes = g_wiimote_scanner.FindWiimotes();
|
found_wiimotes = g_wiimote_scanner.FindWiimotes();
|
||||||
|
lk.lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckForDisconnectedWiimotes();
|
CheckForDisconnectedWiimotes();
|
||||||
|
Reference in New Issue
Block a user