mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-04 20:06:41 +01:00
Merge pull request #9460 from jordan-woyak/wiimote-dc-crash-fix
WiimoteReal: Fix crash on real Wii Remote disconnect on Windows.
This commit is contained in:
commit
2537ea77ee
@ -916,7 +916,9 @@ static void TryToConnectBalanceBoard(std::unique_ptr<Wiimote> wm)
|
|||||||
static void HandleWiimoteDisconnect(int index)
|
static void HandleWiimoteDisconnect(int index)
|
||||||
{
|
{
|
||||||
Core::RunAsCPUThread([index] {
|
Core::RunAsCPUThread([index] {
|
||||||
g_wiimotes[index] = nullptr;
|
// The Wii Remote object must exist through the call to UpdateSource
|
||||||
|
// to prevent WiimoteDevice from having a dangling HIDWiimote pointer.
|
||||||
|
const auto temp_real_wiimote = std::move(g_wiimotes[index]);
|
||||||
WiimoteCommon::UpdateSource(index);
|
WiimoteCommon::UpdateSource(index);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user