1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

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
193 changed files with 1122 additions and 1776 deletions

View File

@@ -1848,6 +1848,13 @@ Object::Object() {
_construct_object(false);
}
void Object::detach_from_objectdb() {
if (_instance_id != ObjectID()) {
ObjectDB::remove_instance(this);
_instance_id = ObjectID();
}
}
Object::~Object() {
if (script_instance) {
memdelete(script_instance);
@@ -1887,8 +1894,10 @@ Object::~Object() {
c.signal.get_object()->_disconnect(c.signal.get_name(), c.callable, true);
}
ObjectDB::remove_instance(this);
_instance_id = ObjectID();
if (_instance_id != ObjectID()) {
ObjectDB::remove_instance(this);
_instance_id = ObjectID();
}
_predelete_ok = 2;
if (_instance_bindings != nullptr) {