From fbb5d649e49ebb7d4df31aede9a3cf44baacbedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 30 Apr 2025 11:01:21 +0200 Subject: [PATCH] Fix hang bug when searching settings in the Developer Tools screen --- Core/Util/GameDB.cpp | 4 ++-- UI/TabbedDialogScreen.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Core/Util/GameDB.cpp b/Core/Util/GameDB.cpp index 6d815f0582..0eb634e1d2 100644 --- a/Core/Util/GameDB.cpp +++ b/Core/Util/GameDB.cpp @@ -142,8 +142,8 @@ bool GameDB::GetGameInfos(std::string_view id, std::vector *infos) { LoadIfNeeded(); - for (auto &line : lines_) { - for (auto &serial : line.serials) { + for (const auto &line : lines_) { + for (const auto serial : line.serials) { // Ignore version and stuff for now if (IDMatches(id, serial)) { GameDBInfo info; diff --git a/UI/TabbedDialogScreen.cpp b/UI/TabbedDialogScreen.cpp index 0072899369..918651b000 100644 --- a/UI/TabbedDialogScreen.cpp +++ b/UI/TabbedDialogScreen.cpp @@ -115,6 +115,7 @@ void TabbedUIDialogScreenWithGameBackground::RecreateViews() { } void TabbedUIDialogScreenWithGameBackground::EnsureTabs() { + _assert_(tabHolder_); tabHolder_->EnsureAllCreated(); } @@ -122,7 +123,7 @@ void TabbedUIDialogScreenWithGameBackground::ApplySearchFilter() { using namespace UI; auto se = GetI18NCategory(I18NCat::SEARCH); - tabHolder_->EnsureAllCreated(); + EnsureTabs(); // Show an indicator that a filter is applied. filterNotice_->SetVisibility(searchFilter_.empty() ? UI::V_GONE : UI::V_VISIBLE); @@ -142,6 +143,8 @@ void TabbedUIDialogScreenWithGameBackground::ApplySearchFilter() { View *v = tabContents->GetViewByIndex(0); if (v->IsViewGroup()) { tabContents = (ViewGroup *)v; + } else { + break; } }