mirror of
https://github.com/tiennm99/godot.git
synced 2026-08-07 04:24:09 +00:00
Narrow FileAccess scope to prevent deadlocks.
This commit is contained in:
@@ -1570,13 +1570,15 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
|
||||
}
|
||||
|
||||
/* write the file */
|
||||
Ref<FileAccess> f = FileAccess::open(file, FileAccess::WRITE);
|
||||
if (f.is_null()) {
|
||||
ERR_PRINT("Can't write '" + file + "'.");
|
||||
unzClose(src_pkg_zip);
|
||||
return ERR_CANT_CREATE;
|
||||
};
|
||||
f->store_buffer(data.ptr(), data.size());
|
||||
{
|
||||
Ref<FileAccess> f = FileAccess::open(file, FileAccess::WRITE);
|
||||
if (f.is_null()) {
|
||||
ERR_PRINT("Can't write '" + file + "'.");
|
||||
unzClose(src_pkg_zip);
|
||||
return ERR_CANT_CREATE;
|
||||
};
|
||||
f->store_buffer(data.ptr(), data.size());
|
||||
}
|
||||
|
||||
#if defined(OSX_ENABLED) || defined(X11_ENABLED)
|
||||
if (is_execute) {
|
||||
@@ -1714,12 +1716,14 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
|
||||
_export_additional_assets(dest_dir + binary_name, libraries, assets);
|
||||
_add_assets_to_project(p_preset, project_file_data, assets);
|
||||
String project_file_name = dest_dir + binary_name + ".xcodeproj/project.pbxproj";
|
||||
Ref<FileAccess> f = FileAccess::open(project_file_name, FileAccess::WRITE);
|
||||
if (f.is_null()) {
|
||||
ERR_PRINT("Can't write '" + project_file_name + "'.");
|
||||
return ERR_CANT_CREATE;
|
||||
};
|
||||
f->store_buffer(project_file_data.ptr(), project_file_data.size());
|
||||
{
|
||||
Ref<FileAccess> f = FileAccess::open(project_file_name, FileAccess::WRITE);
|
||||
if (f.is_null()) {
|
||||
ERR_PRINT("Can't write '" + project_file_name + "'.");
|
||||
return ERR_CANT_CREATE;
|
||||
};
|
||||
f->store_buffer(project_file_data.ptr(), project_file_data.size());
|
||||
}
|
||||
|
||||
#ifdef OSX_ENABLED
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user