From f54b5e03becdec32aca2bcea5f77afe5c0ff2e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 5 Apr 2024 11:03:33 +0200 Subject: [PATCH] Use remove_if correctly. --- Core/Config.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index f4d77b1de7..b62a5e2dfa 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1516,10 +1516,12 @@ void Config::RemoveRecent(const std::string &file) { std::lock_guard guard(private_->recentIsosLock); const auto &filename = File::ResolvePath(file); - std::remove_if(recentIsos.begin(), recentIsos.end(), [filename](const auto &str) { + auto iter = std::remove_if(recentIsos.begin(), recentIsos.end(), [filename](const auto &str) { const auto &recent = File::ResolvePath(str); return filename == recent; }); + // remove_if is weird. + recentIsos.erase(iter, recentIsos.end()); } void Config::CleanRecent() {