mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Merge pull request #10014 from OatmealDome/wiimote-disconnect-crash
WiimoteReal: Fix Wiimote disconnection causing Dolphin to crash on macOS
This commit is contained in:
@ -280,6 +280,14 @@ void Wiimote::Read()
|
||||
Report rpt(MAX_PAYLOAD);
|
||||
auto const result = IORead(rpt.data());
|
||||
|
||||
if (0 == result)
|
||||
{
|
||||
ERROR_LOG_FMT(WIIMOTE, "Wiimote::IORead failed. Disconnecting Wii Remote {}.", m_index + 1);
|
||||
DisconnectInternal();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Drop the report if not connected.
|
||||
if (!m_is_linked)
|
||||
return;
|
||||
@ -297,11 +305,6 @@ void Wiimote::Read()
|
||||
rpt.resize(result);
|
||||
m_read_reports.Push(std::move(rpt));
|
||||
}
|
||||
else if (0 == result)
|
||||
{
|
||||
ERROR_LOG_FMT(WIIMOTE, "Wiimote::IORead failed. Disconnecting Wii Remote {}.", m_index + 1);
|
||||
DisconnectInternal();
|
||||
}
|
||||
}
|
||||
|
||||
bool Wiimote::Write()
|
||||
|
Reference in New Issue
Block a user