[macOS export] Unref FileAccess to ensure chmod is successful.

This commit is contained in:
bruvzg 2022-07-02 00:34:27 +03:00
parent 692c2d9215
commit 4cca1352b9
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38

View file

@ -1086,6 +1086,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
Ref<FileAccess> f = FileAccess::open(file, FileAccess::WRITE);
if (f.is_valid()) {
f->store_buffer(data.ptr(), data.size());
f.unref();
if (is_execute) {
// chmod with 0755 if the file is executable.
FileAccess::set_unix_permissions(file, 0755);