Browse Source
Merge pull request #9690 from german77/whoops
yuzu: config: Avoid reading deleted object
pull/15/merge
liamwhite
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
2 deletions
-
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()); |
|
|
|
|