kern: fix resource leak bugs

This commit is contained in:
Michael Scire 2020-07-23 19:26:46 -07:00 committed by SciresM
parent 11d5353827
commit 46935fea80
4 changed files with 7 additions and 2 deletions

View file

@ -143,7 +143,7 @@ namespace ams::kern {
this->num_kernel_waiters = 0;
this->entrypoint = reinterpret_cast<uintptr_t>(func);
/* We don't need a release (probably), and we've spent no time on the cpu. */
/* We haven't released our resource limit hint, and we've spent no time on the cpu. */
this->resource_limit_release_hint = 0;
this->cpu_time = 0;
@ -825,6 +825,7 @@ namespace ams::kern {
/* Release the thread resource hint from parent. */
if (this->parent != nullptr) {
this->parent->ReleaseResource(ams::svc::LimitableResource_ThreadCountMax, 0, 1);
this->resource_limit_release_hint = true;
}
/* Perform termination. */