diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2024-01-04 15:50:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-04 15:50:33 -0500 |
| commit | cc67a79791ea3c81109c8d29ea35b8a028c08bae (patch) | |
| tree | aba09a6d8801b28dbfb6c7f5f35b4a666db6d931 /src/core/hle/service/hid/controllers/gesture.cpp | |
| parent | d8db5c2032c97de442d897991ab63fd8fa8e3dd8 (diff) | |
| parent | b3e76e2cb1c63e4230b478ac12bbb34668538bbd (diff) | |
Merge pull request #12549 from german77/npadresource
service: hid: Implement NpadResource and NpadData
Diffstat (limited to 'src/core/hle/service/hid/controllers/gesture.cpp')
| -rw-r--r-- | src/core/hle/service/hid/controllers/gesture.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp index 6e686fe65c..c73da13ee1 100644 --- a/src/core/hle/service/hid/controllers/gesture.cpp +++ b/src/core/hle/service/hid/controllers/gesture.cpp @@ -28,10 +28,11 @@ Gesture::Gesture(Core::HID::HIDCore& hid_core_) : ControllerBase(hid_core_) { Gesture::~Gesture() = default; void Gesture::OnInit() { + 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; } @@ -44,10 +45,11 @@ void Gesture::OnInit() { void Gesture::OnRelease() {} void Gesture::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; } |
