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
commit 6bb7c80365
Notes: sideshowbarker 2024-07-19 13:36:50 +09:00

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;
}
}