diff --git a/Kernel/Memory/Region.cpp b/Kernel/Memory/Region.cpp index b757ffee9e..0e2142051a 100644 --- a/Kernel/Memory/Region.cpp +++ b/Kernel/Memory/Region.cpp @@ -38,6 +38,11 @@ Region::Region(VirtualRange const& range, NonnullRefPtr vmobject, size Region::~Region() { + if (is_writable() && vmobject().is_shared_inode()) { + // FIXME: This is very aggressive. Find a way to do less work! + (void)static_cast(vmobject()).sync(); + } + m_vmobject->remove_region(*this); MM.unregister_region(*this);