mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-13 22:54:24 -04:00
kern: fix reference leak in KThread::GetThreadFromId callers
This commit is contained in:
parent
f77a4fbf98
commit
e5d30217d3
2 changed files with 15 additions and 12 deletions
|
@ -291,8 +291,9 @@ namespace ams::kern::svc {
|
|||
R_UNLESS(debug.IsNotNull(), svc::ResultInvalidHandle());
|
||||
|
||||
/* Get the thread from its id. */
|
||||
KScopedAutoObject thread = KThread::GetThreadFromId(thread_id);
|
||||
R_UNLESS(thread.IsNotNull(), svc::ResultInvalidThreadId());
|
||||
KThread *thread = KThread::GetThreadFromId(thread_id);
|
||||
R_UNLESS(thread != nullptr, svc::ResultInvalidThreadId());
|
||||
ON_SCOPE_EXIT { thread->Close(); };
|
||||
|
||||
/* Get the process from the debug object. */
|
||||
KScopedAutoObject process = debug->GetProcess();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue