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

Mono/C#: Add error checks to detect possible Reference leaks

This commit is contained in:
Ignacio Etcheverry
2020-01-13 21:00:07 +01:00
parent ea737db43c
commit a6a5ef0fd6
5 changed files with 51 additions and 4 deletions

View File

@@ -83,7 +83,9 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) {
// See: godot_icall_Reference_Dtor(MonoObject *p_obj, Object *p_ptr)
// May not me referenced yet, so we must use init_ref() instead of reference()
ref->init_ref();
if (ref->init_ref()) {
CSharpLanguage::get_singleton()->post_unsafe_reference(ref);
}
}
// The object was just created, no script instance binding should have been attached