From b530b477f79b336b40f0094275bfb45670163868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 22 Oct 2026 09:03:18 +0200 Subject: [PATCH] DevTools: Don't touch a deleted view when the trace file is picked The save dialog's callback set the path on a stored InfoItem pointer. If the views were recreated while the dialog was open, that view was gone. Recreate the views instead, which reads the path from the tracer. Co-Authored-By: Claude Opus 5.5 (1M context) --- UI/DeveloperToolsScreen.cpp | 7 +++---- UI/DeveloperToolsScreen.h | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/UI/DeveloperToolsScreen.cpp b/UI/DeveloperToolsScreen.cpp index 38e1c9471e..abead2fb46 100644 --- a/UI/DeveloperToolsScreen.cpp +++ b/UI/DeveloperToolsScreen.cpp @@ -350,8 +350,7 @@ void DeveloperToolsScreen::CreateMIPSTracerTab(UI::LinearLayout *list) { return true; }); - MIPSTracerPath_ = mipsTracer.get_logging_path(); - MIPSTracerPath = list->Add(new InfoItem(dev->T("Current log file"), MIPSTracerPath_)); + list->Add(new InfoItem(dev->T("Current log file"), mipsTracer.get_logging_path())); PopupSliderChoice* storage_capacity = list->Add( new PopupSliderChoice( @@ -771,8 +770,8 @@ void DeveloperToolsScreen::OnMIPSTracerPathChanged(UI::EventParams &e) { BrowseFileType::ANY, [this](std::string_view value, int) { mipsTracer.set_logging_path(std::string(value)); - MIPSTracerPath_ = value; - MIPSTracerPath->SetRightText(MIPSTracerPath_); + // The views may have been recreated while the dialog was open, so don't keep a pointer to the path view. + RecreateViews(); } ); } diff --git a/UI/DeveloperToolsScreen.h b/UI/DeveloperToolsScreen.h index 0eb1a025ee..be5720f9f4 100644 --- a/UI/DeveloperToolsScreen.h +++ b/UI/DeveloperToolsScreen.h @@ -53,8 +53,6 @@ private: HasIni hasTexturesIni_ = HasIni::MAYBE; bool MIPSTracerEnabled_ = false; - std::string MIPSTracerPath_ = ""; - UI::InfoItem* MIPSTracerPath = nullptr; int testSliderValue_ = 0; bool pretendIngame_ = false;