summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-23 10:04:39 +0100
committerGitHub <noreply@github.com>2022-03-23 10:04:39 +0100
commitc530a9bffb8eb906fce54768e737ea03c1fbccf0 (patch)
treee4527a43c22ff6146da702c022dfbf62d3ef4caf
parentcd2e7fbc57345370d03854d225208ff480ba6969 (diff)
parent680bcef82546fa0f50b431f20423b62621d1c5ac (diff)
Merge pull request #59432 from timothyqiu/export-crash
-rw-r--r--core/io/dir_access.h4
-rw-r--r--core/io/file_access.h4
-rw-r--r--editor/editor_export.cpp1
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;