1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

VM: Fix leaking PhysicalPage instances.

After PhysicalPage::return_to_freelist(), an actual physical page
is returned back to the memory manager; which will create a new
PhysicalPage instance if it decides to reuse the physical page. This
means this PhysicalPage instance should be freed; otherwise it would
get leaked.
This commit is contained in:
Sergey Bugaev 2019-06-14 15:05:40 +03:00 committed by Andreas Kling
parent 118cb391dd
commit 6bb7c80365

View file

@ -24,8 +24,7 @@ public:
if (!--m_retain_count) {
if (m_may_return_to_freelist)
move(*this).return_to_freelist();
else
delete this;
delete this;
}
}