From 7a13bdbdfbe14134b53ae34b5bb06046813b0248 Mon Sep 17 00:00:00 2001 From: lcsondes Date: Sun, 27 May 2018 21:08:12 +0100 Subject: [PATCH] UICommon: fix m_cached_files pruning (partial revert of 68152faf4352d92192a01ca913c518b25798b2d3) vector::pop_back invalidates all iterators --- Source/Core/UICommon/GameFileCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/UICommon/GameFileCache.cpp b/Source/Core/UICommon/GameFileCache.cpp index 7f9b7015b2..e2e2848f10 100644 --- a/Source/Core/UICommon/GameFileCache.cpp +++ b/Source/Core/UICommon/GameFileCache.cpp @@ -111,9 +111,9 @@ bool GameFileCache::Update( cache_changed = true; --end; *it = std::move(*end); - m_cached_files.pop_back(); } } + m_cached_files.erase(it, m_cached_files.end()); } // Now that the previous loop has run, game_paths only contains paths that