From a5a6ed7f376350ae42b64ba1dbad76f2e4c6fc09 Mon Sep 17 00:00:00 2001 From: Collecting Date: Fri, 9 Jan 2026 04:44:13 +0000 Subject: [PATCH] fix(core): Properly release memory when stopping emulation Signed-off-by: Collecting --- src/common/host_memory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index e0b5a6a67..f632399dd 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -672,7 +672,11 @@ HostMemory::HostMemory(size_t backing_size_, size_t virtual_size_) } } -HostMemory::~HostMemory() = default; +HostMemory::~HostMemory() { + // We leave this empty. + // The "impl" unique_ptr handles the cleanup automatically and correctly. + // Manually calling munmap here causes a "double-free" crash. +} HostMemory::HostMemory(HostMemory&&) noexcept = default;