From 24fe7ed36eeca69bcb1aea5358c800de54b01dc4 Mon Sep 17 00:00:00 2001 From: Collecting Date: Fri, 9 Jan 2026 04:42:27 +0000 Subject: [PATCH] fix(core): Properly release memory when stopping emulation Signed-off-by: Collecting --- src/video_core/vulkan_common/vulkan_memory_allocator.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp index eab9c8f73..b8efdbbf4 100644 --- a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp +++ b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp @@ -383,4 +383,11 @@ std::optional MemoryAllocator::FindType(VkMemoryPropertyFlags flags, u32 ty return std::nullopt; } +void MemoryAllocator::NukeAllAllocations() { + // This calls the destructor for every MemoryAllocation slab. + // Each slab contains a Vulkan handle that will now call vkFreeMemory. + allocations.clear(); + allocations.shrink_to_fit(); +} + } // namespace Vulkan