mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-27 10:50:57 +01:00
yuzu: config: Avoid reading deleted object
This commit is contained in:
parent
e54d08fc1f
commit
e84a441d75
1 changed files with 5 additions and 2 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue