diff options
Diffstat (limited to 'editor/export_template_manager.cpp')
-rw-r--r-- | editor/export_template_manager.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index a1fd2d9049..3526b4ce4c 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -128,7 +128,7 @@ void ExportTemplateManager::_download_current() { } _download_template(mirror_url, true); - } else if (!mirrors_available && !is_refreshing_mirrors) { + } else if (!is_refreshing_mirrors) { _set_current_progress_status(TTR("Retrieving the mirror list...")); _refresh_mirrors(); } @@ -404,9 +404,7 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_ // Read. unzOpenCurrentFile(pkg); ret = unzReadCurrentFile(pkg, data.ptrw(), data.size()); - if (ret != UNZ_OK) { - break; - } + ERR_BREAK_MSG(ret < 0, vformat("An error occurred while attempting to read from file: %s. This file will not be used.", file)); unzCloseCurrentFile(pkg); String data_str; @@ -478,9 +476,7 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_ // Read unzOpenCurrentFile(pkg); ret = unzReadCurrentFile(pkg, data.ptrw(), data.size()); - if (ret != UNZ_OK) { - break; - } + ERR_BREAK_MSG(ret < 0, vformat("An error occurred while attempting to read from file: %s. This file will not be used.", file)); unzCloseCurrentFile(pkg); String base_dir = file_path.get_base_dir().trim_suffix("/"); @@ -514,7 +510,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 +724,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 |