Переглянути джерело

make sure file is closed if something fails

Juan Linietsky 9 роки тому
батько
коміт
f5a3c1ccde
1 змінених файлів з 2 додано та 0 видалено
  1. 2 0
      core/io/config_file.cpp

+ 2 - 0
core/io/config_file.cpp

@@ -127,6 +127,8 @@ Error ConfigFile::save(const String& p_path){
 	FileAccess *file = FileAccess::open(p_path,FileAccess::WRITE,&err);
 
 	if (err) {
+		if (file)
+			memdelete(file);
 		return err;
 	}