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) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-22 10:55:31 +02:00
1 parent 37be6ce4e8
commit b530b477f7
2 files changed
+3 -6

No files matched your search

+3 -4
View File
@@ -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();
}
);
}