mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Break out of the loop waiting for the SearchBT to be done in WiimoteScannerDarwin::FindWiimotes() when the object is destroyed. Allows the application to quit correctly when Continuous Scanning is enabled on macOS.
This commit is contained in:
parent
d306397bbc
commit
8354e89cf1
@ -13,10 +13,12 @@ class WiimoteScannerDarwin final : public WiimoteScannerBackend
|
||||
{
|
||||
public:
|
||||
WiimoteScannerDarwin() = default;
|
||||
~WiimoteScannerDarwin() override = default;
|
||||
~WiimoteScannerDarwin() override;
|
||||
bool IsReady() const override;
|
||||
void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override;
|
||||
void Update() override {} // not needed
|
||||
private:
|
||||
bool stopScanning = false;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,11 @@
|
||||
|
||||
namespace WiimoteReal
|
||||
{
|
||||
WiimoteScannerDarwin::~WiimoteScannerDarwin()
|
||||
{
|
||||
stopScanning = true;
|
||||
}
|
||||
|
||||
void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
|
||||
Wiimote*& found_board)
|
||||
{
|
||||
@ -55,7 +60,7 @@ void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
|
||||
do
|
||||
{
|
||||
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
|
||||
} while (!sbt->done);
|
||||
} while (!sbt->done && !stopScanning);
|
||||
|
||||
int found_devices = [[bti foundDevices] count];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user