Make FileAccess and DirAccess classes reference counted.

This commit is contained in:
bruvzg 2022-03-23 11:08:58 +02:00
parent ca9372622f
commit 9381acb6a4
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
193 changed files with 1122 additions and 1776 deletions

View file

@ -238,11 +238,10 @@ void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api) {
}
}
FileAccessRef f = FileAccess::open(p_output_file, FileAccess::WRITE);
ERR_FAIL_COND_MSG(!f, "Cannot open file '" + p_output_file + "'.");
Ref<FileAccess> f = FileAccess::open(p_output_file, FileAccess::WRITE);
ERR_FAIL_COND_MSG(f.is_null(), "Cannot open file '" + p_output_file + "'.");
JSON json;
f->store_string(json.stringify(classes_dict, "\t"));
f->close();
print_line(String() + "ClassDB API JSON written to: " + ProjectSettings::get_singleton()->globalize_path(p_output_file));
}