aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/hid/controllers/mouse.cpp
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2024-01-01 21:33:07 -0600
committerNarr the Reg <juangerman-13@hotmail.com>2024-01-03 20:21:16 -0600
commitb3e76e2cb1c63e4230b478ac12bbb34668538bbd (patch)
treeaba09a6d8801b28dbfb6c7f5f35b4a666db6d931 /src/core/hle/service/hid/controllers/mouse.cpp
parent1f0a03d1e06a77e7d3d102bc1a4b372bef16e50b (diff)
service: hid: Remove data races when handling shared memory
Diffstat (limited to 'src/core/hle/service/hid/controllers/mouse.cpp')
-rw-r--r--src/core/hle/service/hid/controllers/mouse.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/controllers/mouse.cpp b/src/core/hle/service/hid/controllers/mouse.cpp
index 58deafbc56..3a8d1751b5 100644
--- a/src/core/hle/service/hid/controllers/mouse.cpp
+++ b/src/core/hle/service/hid/controllers/mouse.cpp
@@ -21,10 +21,11 @@ void Mouse::OnInit() {}
void Mouse::OnRelease() {}
void Mouse::OnUpdate(const Core::Timing::CoreTiming& core_timing) {
+ std::scoped_lock shared_lock{*shared_mutex};
const u64 aruid = applet_resource->GetActiveAruid();
auto* data = applet_resource->GetAruidData(aruid);
- if (data == nullptr) {
+ if (data == nullptr || !data->flag.is_assigned) {
return;
}