diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-12-29 20:17:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-29 20:17:04 +0100 |
| commit | 99fbc4b97ecc21c82a8cde602af1bf3b47a186d2 (patch) | |
| tree | c42b16871bed955e337895a8d3c42ee17cf164c8 /Source/Core/InputCommon/ControllerInterface/Wiimote | |
| parent | bf0ac9de0ccf004b86ccadd0a0212fc6804d7600 (diff) | |
| parent | e456bef163c1b667ff5a045a4bda66b30326ae90 (diff) | |
Merge pull request #11885 from Filoppi/devices_deadlock_fix_v2
Input: Improve Controller Interface devices threading
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Wiimote')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.cpp | 10 | ||||
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.h | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.cpp b/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.cpp index 6b92bb9b16..bc2db53328 100644 --- a/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.cpp @@ -1395,14 +1395,10 @@ void Device::UpdateRumble() QueueReport(OutputReportRumble{}); } -void Device::UpdateInput() +Core::DeviceRemoval Device::UpdateInput() { if (!m_wiimote->IsConnected()) - { - g_controller_interface.RemoveDevice( - [this](const Core::Device* device) { return device == this; }); - return; - } + return Core::DeviceRemoval::Remove; UpdateRumble(); RunTasks(); @@ -1413,6 +1409,8 @@ void Device::UpdateInput() ProcessInputReport(report); RunTasks(); } + + return Core::DeviceRemoval::Keep; } void Device::MotionPlusState::ProcessData(const WiimoteEmu::MotionPlus::DataFormat& data) diff --git a/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.h b/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.h index f650f68b46..bbc07e58be 100644 --- a/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.h +++ b/Source/Core/InputCommon/ControllerInterface/Wiimote/WiimoteController.h @@ -35,7 +35,7 @@ public: std::string GetSource() const override; int GetSortPriority() const override; - void UpdateInput() override; + Core::DeviceRemoval UpdateInput() override; private: using Clock = std::chrono::steady_clock; |
