mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 13:18:50 +00: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:
commit
ee863e6722
4 changed files with 139 additions and 14 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue