mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Narrow FileAccess scope to prevent deadlocks.
This commit is contained in:
parent
5974e1432e
commit
4bf99f4af2
29 changed files with 511 additions and 459 deletions
|
|
@ -511,9 +511,11 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
|
|||
String trash_info = "[Trash Info]\nPath=" + path.uri_encode() + "\nDeletionDate=" + timestamp + "\n";
|
||||
{
|
||||
Error err;
|
||||
Ref<FileAccess> file = FileAccess::open(trash_path + "/info/" + file_name + ".trashinfo", FileAccess::WRITE, &err);
|
||||
ERR_FAIL_COND_V_MSG(err != OK, err, "Can't create trashinfo file: \"" + trash_path + "/info/" + file_name + ".trashinfo\"");
|
||||
file->store_string(trash_info);
|
||||
{
|
||||
Ref<FileAccess> file = FileAccess::open(trash_path + "/info/" + file_name + ".trashinfo", FileAccess::WRITE, &err);
|
||||
ERR_FAIL_COND_V_MSG(err != OK, err, "Can't create trashinfo file: \"" + trash_path + "/info/" + file_name + ".trashinfo\"");
|
||||
file->store_string(trash_info);
|
||||
}
|
||||
|
||||
// Rename our resource before moving it to the trash can.
|
||||
Ref<DirAccess> dir_access = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue