diff options
author | Ignacio Etcheverry <neikeq@users.noreply.github.com> | 2019-01-18 01:19:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-18 01:19:51 +0100 |
commit | 938a2515cbc2a6aa5f50e6d78e1554db7b4b5678 (patch) | |
tree | be9a634aef1da54089e5482d3823607e9a938fc6 /modules | |
parent | 1efd37f1b77d71c652fe28a50f42c5284d5ef4ec (diff) | |
parent | b48dd1bdafae18d8a14152795062c0e7e9ad9435 (diff) |
Merge pull request #25078 from neikeq/mm-a
C#: Fix crash due to missing gchandle ref null check
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mono/csharp_script.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 1b2ba58d22..13f8385745 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1189,7 +1189,7 @@ bool CSharpLanguage::refcount_decremented_instance_binding(Object *p_object) { return refcount == 0; Ref<MonoGCHandle> &gchandle = ((Map<Object *, CSharpScriptBinding>::Element *)data)->get().gchandle; - if (refcount == 1 && !gchandle->is_weak()) { // The managed side also holds a reference, hence 1 instead of 0 + if (refcount == 1 && gchandle.is_valid() && !gchandle->is_weak()) { // The managed side also holds a reference, hence 1 instead of 0 // If owner owner is no longer referenced by the unmanaged side, // the managed instance takes responsibility of deleting the owner when GCed. |