From 2ab7222d5bf4ee85c64e220f1d80ac075f7bd163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 17 Dec 2022 22:17:29 +0100 Subject: [PATCH] Clear the extra assert info on game exit --- Common/Log.cpp | 4 ++-- UI/EmuScreen.cpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Common/Log.cpp b/Common/Log.cpp index f54942b67d..b23ba31d42 100644 --- a/Common/Log.cpp +++ b/Common/Log.cpp @@ -36,11 +36,11 @@ static bool hitAnyAsserts = false; std::mutex g_extraAssertInfoMutex; -std::string g_extraAssertInfo = "no extra info set"; +std::string g_extraAssertInfo = "menu"; void SetExtraAssertInfo(const char *info) { std::lock_guard guard(g_extraAssertInfoMutex); - g_extraAssertInfo = info; + g_extraAssertInfo = info ? info : "menu"; } bool HandleAssert(const char *function, const char *file, int line, const char *expression, const char* format, ...) { diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 432eaa1db4..c0579ca7e3 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -402,6 +402,9 @@ EmuScreen::~EmuScreen() { // If we were invalid, it would already be shutdown. PSP_Shutdown(); } + + SetExtraAssertInfo(nullptr); + #ifndef MOBILE_DEVICE if (g_Config.bDumpFrames && startDumping) {