diff options
author | bunnei <bunneidev@gmail.com> | 2021-06-08 06:55:37 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-06-08 06:55:37 +0200 |
commit | 08d798b6fe8b09f28c0302b52c3b832b786d1b8a (patch) | |
tree | 925a674b4f2f7a038aade0dc9e8eb218531b13c8 /src/core/hle/kernel/k_server_session.cpp | |
parent | hle: kernel: Remove service thread manager and use weak_ptr. (diff) | |
download | yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar.gz yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar.bz2 yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar.lz yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar.xz yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar.zst yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.zip |
Diffstat (limited to 'src/core/hle/kernel/k_server_session.cpp')
-rw-r--r-- | src/core/hle/kernel/k_server_session.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/hle/kernel/k_server_session.cpp b/src/core/hle/kernel/k_server_session.cpp index 61213c20e..dd62706a8 100644 --- a/src/core/hle/kernel/k_server_session.cpp +++ b/src/core/hle/kernel/k_server_session.cpp @@ -119,11 +119,16 @@ ResultCode KServerSession::QueueSyncRequest(KThread* thread, Core::Memory::Memor context->PopulateFromIncomingCommandBuffer(kernel.CurrentProcess()->GetHandleTable(), cmd_buf); - if (auto strong_ptr = manager->GetServiceThread().lock()) { - strong_ptr->QueueSyncRequest(*parent, std::move(context)); - return ResultSuccess; + // Ensure we have a session request handler + if (manager->HasSessionRequestHandler(*context)) { + if (auto strong_ptr = manager->GetServiceThread().lock()) { + strong_ptr->QueueSyncRequest(*parent, std::move(context)); + return ResultSuccess; + } else { + ASSERT_MSG(false, "strong_ptr is nullptr!"); + } } else { - ASSERT_MSG(false, "strong_ptr was nullptr!"); + ASSERT_MSG(false, "handler is invalid!"); } return ResultSuccess; |