Browse Source

Merge pull request #23282 from neikeq/issue-23249

C#: Fix crash when disposing Reference on domain finalize
Ignacio Etcheverry 7 năm trước cách đây
mục cha
commit
dbaa223297
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      modules/mono/csharp_script.cpp

+ 2 - 0
modules/mono/csharp_script.cpp

@@ -1407,6 +1407,8 @@ bool CSharpInstance::_unreference_owner_unsafe() {
 	if (!unsafe_referenced)
 		return false; // Already unreferenced
 
+	unsafe_referenced = false;
+
 	// Called from CSharpInstance::mono_object_disposed() or ~CSharpInstance()
 
 	// Unsafe refcount decrement. The managed instance also counts as a reference.