From d306397bbc64b51e891f689252f77c0cfa31983b Mon Sep 17 00:00:00 2001 From: Andrew Molloy Date: Sun, 3 Dec 2017 10:32:07 -0500 Subject: [PATCH] -[deviceInquiryComplete:error:aborted:] comes in on the main thread in macOS 10.13, so instead of using CFRunLoopRun()/CFRunLoopStop(), just let the run loop do one pass. This is already in a loop waiting for done to be false. This also means -[deviceInquiryComplete:error:aborted:] should no longer call CFRunLoopStop(). Fixes connecting to Wiimotes in macOS 10.13+, should continue to work as before in 10.12 and below. --- Source/Core/Core/HW/WiimoteReal/IOdarwin.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm b/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm index 0aada486c4..f0743dc6d6 100644 --- a/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm +++ b/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm @@ -54,7 +54,7 @@ void WiimoteScannerDarwin::FindWiimotes(std::vector& found_wiimotes, do { - CFRunLoopRun(); + CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false); } while (!sbt->done); int found_devices = [[bti foundDevices] count]; @@ -255,7 +255,6 @@ void WiimoteDarwin::DisablePowerAssertionInternal() aborted:(BOOL)aborted { done = true; - CFRunLoopStop(CFRunLoopGetCurrent()); } - (void)deviceInquiryDeviceFound:(IOBluetoothDeviceInquiry*)sender device:(IOBluetoothDevice*)device