Merge pull request #59432 from timothyqiu/export-crash

This commit is contained in:
Rémi Verschelde 2022-03-23 10:04:39 +01:00 committed by GitHub
commit c530a9bffb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View file

@ -137,6 +137,10 @@ struct DirAccessRef {
DirAccess *f = nullptr;
DirAccessRef(DirAccess *fa) { f = fa; }
DirAccessRef(DirAccessRef &&other) {
f = other.f;
other.f = nullptr;
}
~DirAccessRef() {
if (f) {
memdelete(f);

View file

@ -188,6 +188,10 @@ struct FileAccessRef {
operator FileAccess *() { return f; }
FileAccessRef(FileAccess *fa) { f = fa; }
FileAccessRef(FileAccessRef &&other) {
f = other.f;
other.f = nullptr;
}
~FileAccessRef() {
if (f) {
memdelete(f);

View file

@ -1878,7 +1878,6 @@ Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_pr
if (err == OK && !so_files.is_empty()) {
// If shared object files, copy them.
da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
for (int i = 0; i < so_files.size() && err == OK; i++) {
String src_path = ProjectSettings::get_singleton()->globalize_path(so_files[i].path);
String target_path;