summaryrefslogtreecommitdiff
path: root/editor/export_template_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/export_template_manager.cpp')
-rw-r--r--editor/export_template_manager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp
index a1fd2d9049..06c179e77c 100644
--- a/editor/export_template_manager.cpp
+++ b/editor/export_template_manager.cpp
@@ -514,7 +514,7 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_
}
f->store_buffer(data.ptr(), data.size());
-
+ f.unref(); // close file.
#ifndef WINDOWS_ENABLED
FileAccess::set_unix_permissions(to_write, (info.external_fa >> 16) & 0x01FF);
#endif
@@ -728,6 +728,7 @@ Error ExportTemplateManager::install_android_template_from_file(const String &p_
Ref<FileAccess> f = FileAccess::open(to_write, FileAccess::WRITE);
if (f.is_valid()) {
f->store_buffer(data.ptr(), data.size());
+ f.unref(); // close file.
#ifndef WINDOWS_ENABLED
FileAccess::set_unix_permissions(to_write, (info.external_fa >> 16) & 0x01FF);
#endif