diff --git a/src/core/cpu_code_cache.cpp b/src/core/cpu_code_cache.cpp index 4a0fca601..1a979d4ae 100644 --- a/src/core/cpu_code_cache.cpp +++ b/src/core/cpu_code_cache.cpp @@ -21,7 +21,8 @@ CodeCache::CodeCache() = default; CodeCache::~CodeCache() { - Flush(); + if (m_system) + Flush(); } void CodeCache::Initialize(System* system, Core* core, Bus* bus, bool use_recompiler)