diff options
Diffstat (limited to 'Private/Source')
| -rw-r--r-- | Private/Source/ProcessManager.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Private/Source/ProcessManager.cxx b/Private/Source/ProcessManager.cxx index ea9ba1f5..af3fa351 100644 --- a/Private/Source/ProcessManager.cxx +++ b/Private/Source/ProcessManager.cxx @@ -133,8 +133,9 @@ void Process::Exit(Int32 exit_code) { if (this->Ring != (Int32)ProcessSelector::kRingDriver && this->Ring != (Int32)ProcessSelector::kRingKernel) { - ke_free_heap(this->Pool); + if (this->Pool) ke_free_heap(this->Pool); + this->Pool = nullptr; this->PoolCursor = nullptr; this->FreeMemory = kPoolMaxSz; @@ -143,9 +144,11 @@ void Process::Exit(Int32 exit_code) { //! Delete image if not done already. if (this->Image) ke_delete_ke_heap(this->Image); - if (this->StackFrame) ke_delete_ke_heap((VoidPtr)this->StackFrame); + this->Image = nullptr; + this->StackFrame = nullptr; + ProcessManager::Shared().Leak().Remove(this->ProcessId); } |
