mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-01 10:20:33 +00:00
Fix comparison to invalidated vector iterator.
GetFstEntryForPath may modify the children vector, so do it before taking an iterator to the vector.
This commit is contained in:
parent
9d880c2db3
commit
9a5a705d01
@ -515,9 +515,9 @@ ResultCode HostFileSystem::Rename(Uid uid, Gid gid, const std::string& old_path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Finally, remove the child from the old parent and move it to the new parent.
|
// Finally, remove the child from the old parent and move it to the new parent.
|
||||||
|
FstEntry* new_entry = GetFstEntryForPath(new_path);
|
||||||
const auto it = std::find_if(old_parent->children.begin(), old_parent->children.end(),
|
const auto it = std::find_if(old_parent->children.begin(), old_parent->children.end(),
|
||||||
GetNamePredicate(split_old_path.file_name));
|
GetNamePredicate(split_old_path.file_name));
|
||||||
FstEntry* new_entry = GetFstEntryForPath(new_path);
|
|
||||||
if (it != old_parent->children.end())
|
if (it != old_parent->children.end())
|
||||||
{
|
{
|
||||||
*new_entry = *it;
|
*new_entry = *it;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user