From a43a0a14cc6fbb95d10da8af777040327d9f74df Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 16 Apr 2020 20:23:54 +1000 Subject: [PATCH] CPU/CodeCache: Don't leak blocks on shutdown --- src/core/cpu_code_cache.cpp | 5 ++++- src/core/system.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/cpu_code_cache.cpp b/src/core/cpu_code_cache.cpp index b0ec893b1..4a0fca601 100644 --- a/src/core/cpu_code_cache.cpp +++ b/src/core/cpu_code_cache.cpp @@ -19,7 +19,10 @@ static constexpr u32 RECOMPILER_FAR_CODE_CACHE_SIZE = 32 * 1024 * 1024; CodeCache::CodeCache() = default; -CodeCache::~CodeCache() = default; +CodeCache::~CodeCache() +{ + Flush(); +} void CodeCache::Initialize(System* system, Core* core, Bus* bus, bool use_recompiler) { diff --git a/src/core/system.cpp b/src/core/system.cpp index 59cb49c88..7824140c2 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -254,8 +254,8 @@ void System::DestroyComponents() m_gpu.reset(); m_interrupt_controller.reset(); m_dma.reset(); - m_bus.reset(); m_cpu_code_cache.reset(); + m_bus.reset(); m_cpu.reset(); }