summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FatFsUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/FatFsUtil.cpp')
-rw-r--r--Source/Core/Common/FatFsUtil.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Core/Common/FatFsUtil.cpp b/Source/Core/Common/FatFsUtil.cpp
index 21cf88a6ab..f194dc22a3 100644
--- a/Source/Core/Common/FatFsUtil.cpp
+++ b/Source/Core/Common/FatFsUtil.cpp
@@ -535,7 +535,10 @@ bool SyncSDFolderToSDImage(const std::function<bool()>& cancelled, bool determin
}
// delete temp file in failure case
- Common::ScopeGuard image_delete_guard{[&] { File::Delete(temp_image_path); }};
+ Common::ScopeGuard image_delete_guard{[&] {
+ image.Close();
+ File::Delete(temp_image_path);
+ }};
if (!image.Resize(size))
{