mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 21:51:22 +00:00 
			
		
		
		
	Added error checks for fscache saving
(cherry picked from commit 06e537fec5)
			
			
This commit is contained in:
		
							parent
							
								
									3503ee4be6
								
							
						
					
					
						commit
						c2e02e2066
					
				
					 2 changed files with 16 additions and 11 deletions
				
			
		|  | @ -275,9 +275,13 @@ void EditorFileSystem::_scan_filesystem() { | |||
| 	memdelete(d); | ||||
| 
 | ||||
| 	f = FileAccess::open(fscache, FileAccess::WRITE); | ||||
| 	_save_filesystem_cache(new_filesystem, f); | ||||
| 	f->close(); | ||||
| 	memdelete(f); | ||||
| 	if (f == NULL) { | ||||
| 		ERR_PRINTS("Error writing fscache: " + fscache); | ||||
| 	} else { | ||||
| 		_save_filesystem_cache(new_filesystem, f); | ||||
| 		f->close(); | ||||
| 		memdelete(f); | ||||
| 	} | ||||
| 
 | ||||
| 	scanning = false; | ||||
| } | ||||
|  | @ -286,9 +290,13 @@ void EditorFileSystem::_save_filesystem_cache() { | |||
| 	String fscache = EditorSettings::get_singleton()->get_project_settings_dir().plus_file("filesystem_cache3"); | ||||
| 
 | ||||
| 	FileAccess *f = FileAccess::open(fscache, FileAccess::WRITE); | ||||
| 	_save_filesystem_cache(filesystem, f); | ||||
| 	f->close(); | ||||
| 	memdelete(f); | ||||
| 	if (f == NULL) { | ||||
| 		ERR_PRINTS("Error writing fscache: " + fscache); | ||||
| 	} else { | ||||
| 		_save_filesystem_cache(filesystem, f); | ||||
| 		f->close(); | ||||
| 		memdelete(f); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| void EditorFileSystem::_thread_func(void *_userdata) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Marcelo Fernandez
						Marcelo Fernandez