From 020e39baa98c44b93d068f0432d422744a6912da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 23 Oct 2026 11:52:52 +0200 Subject: [PATCH] RecentFiles: Make the loaded list visible right away Load() only queued the list for the worker thread, so reading it right after loading the config could still see an empty list. Android's grant pruning does exactly that, and would then treat recent games as unreferenced, release their grants, and the queued clean would drop them from the list as missing. Co-Authored-By: Claude Opus 5.5 (1M context) --- Core/Util/RecentFiles.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/Util/RecentFiles.cpp b/Core/Util/RecentFiles.cpp index eb06d673e6..785a537e73 100644 --- a/Core/Util/RecentFiles.cpp +++ b/Core/Util/RecentFiles.cpp @@ -101,6 +101,12 @@ void RecentFilesManager::Load(const Section *recent, int maxRecent) { // Just zapping any pending command, since they won't matter after this. // TODO: Maybe we should let adds through... WipePendingCommandsUnderLock(); + // Visible right away, for callers that read the list straight after loading the config (Android's + // URI grant pruning). The queued ReplaceAll still runs, in case a command was mid-flight. + { + std::lock_guard recentGuard(recentLock_); + recentFiles_ = newRecent; + } cmds_.push(RecentCommand{ RecentCmd::ReplaceAll, std::make_unique>(newRecent) }); cmdCondVar_.notify_one(); }