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 /core/io | |
parent | cd2e7fbc57345370d03854d225208ff480ba6969 (diff) | |
parent | 680bcef82546fa0f50b431f20423b62621d1c5ac (diff) |
Merge pull request #59432 from timothyqiu/export-crash
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/dir_access.h | 4 | ||||
-rw-r--r-- | core/io/file_access.h | 4 |
2 files changed, 8 insertions, 0 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); |