IOS/ESFormats: Fix content map writing

On Windows, this would fail because the file handle wasn't closed.
This commit is contained in:
Léo Lam 2017-06-14 23:13:46 +02:00
parent 8865208571
commit a370ad5f6d

View File

@ -533,10 +533,12 @@ bool SharedContentMap::WriteEntries() const
File::CreateFullPath(temp_path);
// Atomically write the new content map.
File::IOFile file(temp_path, "w+b");
if (!file.WriteArray(m_entries.data(), m_entries.size()))
return false;
File::CreateFullPath(m_file_path);
{
File::IOFile file(temp_path, "w+b");
if (!file.WriteArray(m_entries.data(), m_entries.size()))
return false;
File::CreateFullPath(m_file_path);
}
return File::RenameSync(temp_path, m_file_path);
}