mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	Make FileAccess and DirAccess classes reference counted.
This commit is contained in:
		
							parent
							
								
									ca9372622f
								
							
						
					
					
						commit
						9381acb6a4
					
				
					 193 changed files with 1122 additions and 1776 deletions
				
			
		|  | @ -3642,19 +3642,15 @@ Error ResourceFormatSaverCSharpScript::save(const String &p_path, const RES &p_r | |||
| #endif | ||||
| 
 | ||||
| 	Error err; | ||||
| 	FileAccess *file = FileAccess::open(p_path, FileAccess::WRITE, &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); | ||||
| 
 | ||||
| 	if (file->get_error() != OK && file->get_error() != ERR_FILE_EOF) { | ||||
| 		memdelete(file); | ||||
| 		return ERR_CANT_CREATE; | ||||
| 	} | ||||
| 
 | ||||
| 	file->close(); | ||||
| 	memdelete(file); | ||||
| 
 | ||||
| #ifdef TOOLS_ENABLED | ||||
| 	if (ScriptServer::is_reload_scripts_on_save_enabled()) { | ||||
| 		CSharpLanguage::get_singleton()->reload_tool_script(p_resource, false); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bruvzg
						bruvzg