System: Fix crash when toggling memory exceptions off

This commit is contained in:
Connor McLaughlin 2022-09-17 14:26:49 +10:00
parent 05eecf9944
commit 3e16dbfc37
1 changed files with 6 additions and 1 deletions

View File

@ -3124,7 +3124,12 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
{ {
Host::AddOSDMessage(Host::TranslateStdString("OSDMessage", "Recompiler options changed, flushing all blocks."), Host::AddOSDMessage(Host::TranslateStdString("OSDMessage", "Recompiler options changed, flushing all blocks."),
5.0f); 5.0f);
CPU::CodeCache::Flush();
// changing memory exceptions can re-enable fastmem
if (g_settings.cpu_recompiler_memory_exceptions != old_settings.cpu_recompiler_memory_exceptions)
CPU::CodeCache::Reinitialize();
else
CPU::CodeCache::Flush();
if (g_settings.cpu_recompiler_icache != old_settings.cpu_recompiler_icache) if (g_settings.cpu_recompiler_icache != old_settings.cpu_recompiler_icache)
CPU::ClearICache(); CPU::ClearICache();