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

@ -46,7 +46,6 @@ void EditorFileServer::_close_client(ClientData *cd) {
cd->efs->to_wait.insert(cd->thread);
}
while (cd->files.size()) {
memdelete(cd->files.front()->get());
cd->files.erase(cd->files.front());
}
memdelete(cd);
@ -181,8 +180,8 @@ void EditorFileServer::_subthread_start(void *s) {
break;
}
FileAccess *fa = FileAccess::open(s2, FileAccess::READ);
if (!fa) {
Ref<FileAccess> fa = FileAccess::open(s2, FileAccess::READ);
if (fa.is_null()) {
//not found, continue
encode_uint32(id, buf4);
cd->connection->put_data(buf4, 4);
@ -249,7 +248,6 @@ void EditorFileServer::_subthread_start(void *s) {
case FileAccessNetwork::COMMAND_CLOSE: {
print_verbose("CLOSED");
ERR_CONTINUE(!cd->files.has(id));
memdelete(cd->files[id]);
cd->files.erase(id);
} break;
}