mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 03:18:55 +02:00
[hid] shared memory crashes (#3784)
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3784 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Lizzie <lizzie@eden-emu.dev> Co-authored-by: maufeat <sahyno1996@gmail.com> Co-committed-by: maufeat <sahyno1996@gmail.com>
This commit is contained in:
parent
5856beac54
commit
c984c387d7
1 changed files with 4 additions and 0 deletions
|
|
@ -800,6 +800,10 @@ Result NPad::DisconnectNpad(u64 aruid, Core::HID::NpadIdType npad_id) {
|
|||
auto& controller = GetControllerFromNpadIdType(aruid, npad_id);
|
||||
|
||||
auto* shared_memory = controller.shared_memory;
|
||||
if (!shared_memory) {
|
||||
LOG_WARNING(Service_HID, "DisconnectNpad: shared_memory is null for npad_id={}", npad_id);
|
||||
return ResultSuccess;
|
||||
}
|
||||
// Don't reset shared_memory->assignment_mode this value is persistent
|
||||
shared_memory->style_tag.raw = Core::HID::NpadStyleSet::None; // Zero out
|
||||
shared_memory->device_type.raw = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue