mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-19 02:36:27 +01: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:
|
public:
|
||||||
WiimoteScannerDarwin() = default;
|
WiimoteScannerDarwin() = default;
|
||||||
~WiimoteScannerDarwin() override = default;
|
~WiimoteScannerDarwin() override;
|
||||||
bool IsReady() const override;
|
bool IsReady() const override;
|
||||||
void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override;
|
void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override;
|
||||||
void Update() override {} // not needed
|
void Update() override {} // not needed
|
||||||
|
private:
|
||||||
|
bool stopScanning = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,11 @@
|
|||||||
|
|
||||||
namespace WiimoteReal
|
namespace WiimoteReal
|
||||||
{
|
{
|
||||||
|
WiimoteScannerDarwin::~WiimoteScannerDarwin()
|
||||||
|
{
|
||||||
|
stopScanning = true;
|
||||||
|
}
|
||||||
|
|
||||||
void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
|
void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
|
||||||
Wiimote*& found_board)
|
Wiimote*& found_board)
|
||||||
{
|
{
|
||||||
@ -55,7 +60,7 @@ void WiimoteScannerDarwin::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
|
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
|
||||||
} while (!sbt->done);
|
} while (!sbt->done && !stopScanning);
|
||||||
|
|
||||||
int found_devices = [[bti foundDevices] count];
|
int found_devices = [[bti foundDevices] count];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user