Merge pull request #23282 from neikeq/issue-23249

C#: Fix crash when disposing Reference on domain finalize
This commit is contained in:
Ignacio Etcheverry 2018-10-25 17:33:28 +02:00 committed by GitHub
commit dbaa223297
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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