From a370ad5f6d43ea63496f05e081603ce4300261e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Wed, 14 Jun 2017 23:13:46 +0200 Subject: [PATCH] IOS/ESFormats: Fix content map writing On Windows, this would fail because the file handle wasn't closed. --- Source/Core/Core/IOS/ES/Formats.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/IOS/ES/Formats.cpp b/Source/Core/Core/IOS/ES/Formats.cpp index f66e61c07b..3de8deb312 100644 --- a/Source/Core/Core/IOS/ES/Formats.cpp +++ b/Source/Core/Core/IOS/ES/Formats.cpp @@ -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); }