summaryrefslogtreecommitdiffstats
path: root/platform/osx/export/export_plugin.cpp
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-05-11 15:15:58 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-05-11 16:08:17 +0300
commitd36c5514d3893578f1c8cce4d0a2256abfcdd1ed (patch)
treec591ac745d635c3320f7a858cdd7dd43065a894a /platform/osx/export/export_plugin.cpp
parent9963ae3553d059e4ac3b57c7a4cdc55d1a87d49a (diff)
downloadredot-engine-d36c5514d3893578f1c8cce4d0a2256abfcdd1ed.tar.gz
Fix ZipIO crash when reused (and possible leaks).
Diffstat (limited to 'platform/osx/export/export_plugin.cpp')
-rw-r--r--platform/osx/export/export_plugin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/osx/export/export_plugin.cpp b/platform/osx/export/export_plugin.cpp
index 94ef875072..465925524c 100644
--- a/platform/osx/export/export_plugin.cpp
+++ b/platform/osx/export/export_plugin.cpp
@@ -722,7 +722,8 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
return ERR_FILE_BAD_PATH;
}
- zlib_filefunc_def io = zipio_create_io();
+ Ref<FileAccess> io_fa;
+ zlib_filefunc_def io = zipio_create_io(&io_fa);
if (ep.step(TTR("Creating app bundle"), 0)) {
return ERR_SKIP;
@@ -1327,7 +1328,8 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
OS::get_singleton()->move_to_trash(p_path);
}
- zlib_filefunc_def io_dst = zipio_create_io();
+ Ref<FileAccess> io_fa_dst;
+ zlib_filefunc_def io_dst = zipio_create_io(&io_fa_dst);
zipFile zip = zipOpen2(p_path.utf8().get_data(), APPEND_STATUS_CREATE, nullptr, &io_dst);
_zip_folder_recursive(zip, tmp_base_path_name, "", pkg_name);