diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-03-23 10:04:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-23 10:04:39 +0100 |
commit | c530a9bffb8eb906fce54768e737ea03c1fbccf0 (patch) | |
tree | e4527a43c22ff6146da702c022dfbf62d3ef4caf | |
parent | cd2e7fbc57345370d03854d225208ff480ba6969 (diff) | |
parent | 680bcef82546fa0f50b431f20423b62621d1c5ac (diff) |
Merge pull request #59432 from timothyqiu/export-crash
-rw-r--r-- | core/io/dir_access.h | 4 | ||||
-rw-r--r-- | core/io/file_access.h | 4 | ||||
-rw-r--r-- | editor/editor_export.cpp | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/core/io/dir_access.h b/core/io/dir_access.h index d63453e947..b97d097842 100644 --- a/core/io/dir_access.h +++ b/core/io/dir_access.h @@ -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); diff --git a/core/io/file_access.h b/core/io/file_access.h index 5413665440..a6cb5d9fc6 100644 --- a/core/io/file_access.h +++ b/core/io/file_access.h @@ -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); diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index afb5bd9d4d..bbc104301d 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -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; |