Skip to content

Commit 9721872

Browse files
committed
fixed memory leak bug
1 parent bd1d0f4 commit 9721872

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

core/common/Logger.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class Logger
7575
}
7676
void printAll()
7777
{
78+
std::cout << "\nLogs:=======================================\n";
7879
for (std::size_t i = 0; i < this->messages.size(); ++i)
7980
std::cout << this->messages[i] << std::endl;
8081
}

core/kernel/Process.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ class Process
5353
this->threads.clear();
5454

5555
for (Mutex* mutex : this->mutexList) delete mutex;
56+
57+
for (FileHandleInterface* handle : this->fdTable)
58+
{
59+
if (handle != nullptr)
60+
delete handle;
61+
}
62+
63+
this->fdTable.clear();
5664
this->mutexList.clear();
5765
}
5866
};

0 commit comments

Comments
 (0)