From 87c2201873781b4dcaf2db9c0c8b951cf9a51287 Mon Sep 17 00:00:00 2001 From: The Dax Date: Mon, 27 Jan 2014 23:34:02 -0500 Subject: [PATCH] Don't crash when enable debug stats is enabled in a game, then turned off after exiting a game. --- UI/GameSettingsScreen.cpp | 4 +--- UI/MiscScreens.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 8da29cf909..e747372492 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -434,9 +434,7 @@ void GameSettingsScreen::update(InputState &input) { g_Config.iFpsLimit = alternateSpeedTable[iAlternateSpeedPercent_]; if (g_Config.bShowDebugStats != showDebugStats_) { // This affects the jit. - if (MIPSComp::jit) { - MIPSComp::jit->ClearCache(); - } + NativeMessageReceived("clear jit", ""); g_Config.bShowDebugStats = showDebugStats_; } } diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 06ff21594e..8bba528671 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -101,7 +101,7 @@ void DrawBackground(float alpha) { void HandleCommonMessages(const char *message, const char *value, ScreenManager *manager) { if (!strcmp(message, "clear jit")) { - if (MIPSComp::jit) { + if (MIPSComp::jit && PSP_IsInited()) { MIPSComp::jit->ClearCache(); } }