summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-01-29 04:28:38 +0100
committerGitHub <noreply@github.com>2023-01-29 04:28:38 +0100
commit236f591bde7450d5f78df282a8d23ed19c3a14c9 (patch)
tree7d1c893d1da3e5efd87186b740441be42100462b
parentMerge pull request #9687 from ameerj/ogl-shader-ms (diff)
parentyuzu: config: Avoid reading deleted object (diff)
downloadyuzu-236f591bde7450d5f78df282a8d23ed19c3a14c9.tar
yuzu-236f591bde7450d5f78df282a8d23ed19c3a14c9.tar.gz
yuzu-236f591bde7450d5f78df282a8d23ed19c3a14c9.tar.bz2
yuzu-236f591bde7450d5f78df282a8d23ed19c3a14c9.tar.lz
yuzu-236f591bde7450d5f78df282a8d23ed19c3a14c9.tar.xz
yuzu-236f591bde7450d5f78df282a8d23ed19c3a14c9.tar.zst
yuzu-236f591bde7450d5f78df282a8d23ed19c3a14c9.zip
-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() {
std::vector<std::string> profile_names;
profile_names.reserve(map_profiles.size());
- for (const auto& [profile_name, config] : map_profiles) {
+ auto it = map_profiles.cbegin();
+ while (it != map_profiles.cend()) {
+ const auto& [profile_name, config] = *it;
if (!ProfileExistsInFilesystem(profile_name)) {
- DeleteProfile(profile_name);
+ it = map_profiles.erase(it);
continue;
}
profile_names.push_back(profile_name);
+ ++it;
}
std::stable_sort(profile_names.begin(), profile_names.end());