summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar liamwhite2023-01-28 22:28:38 -0500
committerGravatar GitHub2023-01-28 22:28:38 -0500
commit236f591bde7450d5f78df282a8d23ed19c3a14c9 (patch)
tree7d1c893d1da3e5efd87186b740441be42100462b
parentMerge pull request #9687 from ameerj/ogl-shader-ms (diff)
parentyuzu: config: Avoid reading deleted object (diff)
downloadyuzu-236f591bde7450d5f78df282a8d23ed19c3a14c9.tar.gz
yuzu-236f591bde7450d5f78df282a8d23ed19c3a14c9.tar.xz
yuzu-236f591bde7450d5f78df282a8d23ed19c3a14c9.zip
Merge pull request #9690 from german77/whoops
yuzu: config: Avoid reading deleted object
Diffstat (limited to '')
-rw-r--r--src/yuzu/configuration/input_profiles.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/yuzu/configuration/input_profiles.cpp b/src/yuzu/configuration/input_profiles.cpp
index 9bb69cab1..41ef4250a 100644
--- a/src/yuzu/configuration/input_profiles.cpp
+++ b/src/yuzu/configuration/input_profiles.cpp
@@ -58,13 +58,16 @@ std::vector<std::string> InputProfiles::GetInputProfileNames() {
58 std::vector<std::string> profile_names; 58 std::vector<std::string> profile_names;
59 profile_names.reserve(map_profiles.size()); 59 profile_names.reserve(map_profiles.size());
60 60
61 for (const auto& [profile_name, config] : map_profiles) { 61 auto it = map_profiles.cbegin();
62 while (it != map_profiles.cend()) {
63 const auto& [profile_name, config] = *it;
62 if (!ProfileExistsInFilesystem(profile_name)) { 64 if (!ProfileExistsInFilesystem(profile_name)) {
63 DeleteProfile(profile_name); 65 it = map_profiles.erase(it);
64 continue; 66 continue;
65 } 67 }
66 68
67 profile_names.push_back(profile_name); 69 profile_names.push_back(profile_name);
70 ++it;
68 } 71 }
69 72
70 std::stable_sort(profile_names.begin(), profile_names.end()); 73 std::stable_sort(profile_names.begin(), profile_names.end());