summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorFeng Chen <vonchenplus@gmail.com>2021-10-25 12:55:20 +0200
committerFeng Chen <vonchenplus@gmail.com>2021-10-27 03:06:22 +0200
commita8b01049235bffa13d18a010311c16c8b9c316b4 (patch)
tree3e8f433c3da629b09a4b3e000047ceb6f8ac3ec0 /src/core/hle/kernel/svc.cpp
parentMerge pull request #7218 from bylaws/aswdqdsam (diff)
downloadyuzu-a8b01049235bffa13d18a010311c16c8b9c316b4.tar
yuzu-a8b01049235bffa13d18a010311c16c8b9c316b4.tar.gz
yuzu-a8b01049235bffa13d18a010311c16c8b9c316b4.tar.bz2
yuzu-a8b01049235bffa13d18a010311c16c8b9c316b4.tar.lz
yuzu-a8b01049235bffa13d18a010311c16c8b9c316b4.tar.xz
yuzu-a8b01049235bffa13d18a010311c16c8b9c316b4.tar.zst
yuzu-a8b01049235bffa13d18a010311c16c8b9c316b4.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/svc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index f98f24a60..d30755b7e 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -427,11 +427,15 @@ static ResultCode WaitSynchronization(Core::System& system, s32* index, VAddr ha
R_UNLESS(handle_table.GetMultipleObjects<KSynchronizationObject>(objs.data(), handles,
num_handles),
ResultInvalidHandle);
+ for (const auto& obj : objs) {
+ kernel.RegisterInUseObject(obj);
+ }
}
// Ensure handles are closed when we're done.
SCOPE_EXIT({
for (u64 i = 0; i < num_handles; ++i) {
+ kernel.UnregisterInUseObject(objs[i]);
objs[i]->Close();
}
});
@@ -1544,6 +1548,7 @@ static ResultCode StartThread(Core::System& system, Handle thread_handle) {
// If we succeeded, persist a reference to the thread.
thread->Open();
+ system.Kernel().RegisterInUseObject(thread.GetPointerUnsafe());
return ResultSuccess;
}
@@ -1559,6 +1564,7 @@ static void ExitThread(Core::System& system) {
auto* const current_thread = system.Kernel().CurrentScheduler()->GetCurrentThread();
system.GlobalSchedulerContext().RemoveThread(current_thread);
current_thread->Exit();
+ system.Kernel().UnregisterInUseObject(current_thread);
}
static void ExitThread32(Core::System& system) {