mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +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
|
@ -3641,14 +3641,16 @@ Error ResourceFormatSaverCSharpScript::save(const String &p_path, const RES &p_r
|
|||
}
|
||||
#endif
|
||||
|
||||
Error err;
|
||||
Ref<FileAccess> file = FileAccess::open(p_path, FileAccess::WRITE, &err);
|
||||
ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot save C# script file '" + p_path + "'.");
|
||||
{
|
||||
Error err;
|
||||
Ref<FileAccess> file = FileAccess::open(p_path, FileAccess::WRITE, &err);
|
||||
ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot save C# script file '" + p_path + "'.");
|
||||
|
||||
file->store_string(source);
|
||||
file->store_string(source);
|
||||
|
||||
if (file->get_error() != OK && file->get_error() != ERR_FILE_EOF) {
|
||||
return ERR_CANT_CREATE;
|
||||
if (file->get_error() != OK && file->get_error() != ERR_FILE_EOF) {
|
||||
return ERR_CANT_CREATE;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue