diff options
| author | Feng Chen <vonchenplus@gmail.com> | 2021-10-26 18:12:13 +0800 |
|---|---|---|
| committer | Feng Chen <vonchenplus@gmail.com> | 2021-10-27 09:06:30 +0800 |
| commit | dd29285e356838b2326f1d2261f0a97eeded713e (patch) | |
| tree | 4f71c3446f4164ec06beae0f7fed23e0b022ddc2 /src/core/hle/kernel/k_process.cpp | |
| parent | 052017e189a2558dba1dd47147ab9274f218b7fc (diff) | |
Fix dangling kernel objects when exiting
Diffstat (limited to 'src/core/hle/kernel/k_process.cpp')
| -rw-r--r-- | src/core/hle/kernel/k_process.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp index 211157ccc..76fd8c285 100644 --- a/src/core/hle/kernel/k_process.cpp +++ b/src/core/hle/kernel/k_process.cpp @@ -434,11 +434,6 @@ void KProcess::PrepareForTermination() { } void KProcess::Finalize() { - // Release memory to the resource limit. - if (resource_limit != nullptr) { - resource_limit->Close(); - } - // Finalize the handle table and close any open handles. handle_table.Finalize(); @@ -460,6 +455,12 @@ void KProcess::Finalize() { } } + // Release memory to the resource limit. + if (resource_limit != nullptr) { + resource_limit->Close(); + resource_limit = nullptr; + } + // Perform inherited finalization. KAutoObjectWithSlabHeapAndContainer<KProcess, KSynchronizationObject>::Finalize(); } |
