summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/os_linuxbsd.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-03-11 12:51:22 +0100
committerGitHub <noreply@github.com>2022-03-11 12:51:22 +0100
commit015fdfc28d3709387383b365a91c78dc0fe7aa35 (patch)
tree16a7a83bd1083ac61e30039db8a573e930ca35b8 /platform/linuxbsd/os_linuxbsd.cpp
parent1e099afc8ac420f5c97b07067e28d6309ed55ae7 (diff)
parent768f9422bc3b1349729b8a50feb8c0797003aee9 (diff)
downloadredot-engine-015fdfc28d3709387383b365a91c78dc0fe7aa35.tar.gz
Merge pull request #58986 from akien-mga/diraccessref
Diffstat (limited to 'platform/linuxbsd/os_linuxbsd.cpp')
-rw-r--r--platform/linuxbsd/os_linuxbsd.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp
index 140368987c..86874687ad 100644
--- a/platform/linuxbsd/os_linuxbsd.cpp
+++ b/platform/linuxbsd/os_linuxbsd.cpp
@@ -535,9 +535,8 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
// Issue an error if "mv" failed to move the given resource to the trash can.
if (err != OK || retval != 0) {
ERR_PRINT("move_to_trash: Could not move the resource \"" + path + "\" to the trash can \"" + trash_path + "/files\"");
- DirAccess *dir_access = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ DirAccessRef dir_access = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
err = dir_access->rename(renamed_path, path);
- memdelete(dir_access);
ERR_FAIL_COND_V_MSG(err != OK, err, "Could not rename \"" + renamed_path + "\" back to its original name: \"" + path + "\"");
return FAILED;
}