1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +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

@@ -108,6 +108,7 @@ void godot_icall_Reference_Disposed(MonoObject *p_obj, Object *p_ptr, MonoBoolea
// Unsafe refcount decrement. The managed instance also counts as a reference.
// See: CSharpLanguage::alloc_instance_binding_data(Object *p_object)
CSharpLanguage::get_singleton()->pre_unsafe_unreference(ref);
if (ref->unreference()) {
memdelete(ref);
} else {