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

@ -346,7 +346,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
ERR_FAIL_V_MSG(data, err_string);
}
FileAccess *f = FileAccess::open(tmp_path, FileAccess::READ, &err);
Ref<FileAccess> f = FileAccess::open(tmp_path, FileAccess::READ, &err);
if (err != OK) {
String err_string = "Couldn't open temp logo file.";
@ -359,8 +359,6 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
data.resize(f->get_length());
f->get_buffer(data.ptrw(), data.size());
f->close();
memdelete(f);
DirAccess::remove_file_or_error(tmp_path);
return data;