mirror of
https://github.com/godotengine/godot.git
synced 2026-02-11 04:10:42 +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
|
|
@ -145,7 +145,7 @@ Ref<GDScriptParserRef> GDScriptCache::get_parser(const String &p_path, GDScriptP
|
|||
String GDScriptCache::get_source_code(const String &p_path) {
|
||||
Vector<uint8_t> source_file;
|
||||
Error err;
|
||||
FileAccessRef f = FileAccess::open(p_path, FileAccess::READ, &err);
|
||||
Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::READ, &err);
|
||||
if (err) {
|
||||
ERR_FAIL_COND_V(err, "");
|
||||
}
|
||||
|
|
@ -153,7 +153,6 @@ String GDScriptCache::get_source_code(const String &p_path) {
|
|||
uint64_t len = f->get_length();
|
||||
source_file.resize(len + 1);
|
||||
uint64_t r = f->get_buffer(source_file.ptrw(), len);
|
||||
f->close();
|
||||
ERR_FAIL_COND_V(r != len, "");
|
||||
source_file.write[len] = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue