summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2018-10-25 17:21:42 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2018-10-25 17:21:42 +0200
commitb42f7b7fae627de8db4bef5bc036e6b29a1aab04 (patch)
tree2111834e85e9b14637942aba7a916db919285e6a /modules
parent7a42df3626159d1d81d2b5aabf13f19ef1951976 (diff)
C#: Fix crash when disposing Reference on domain finalize
Diffstat (limited to 'modules')
-rw-r--r--modules/mono/csharp_script.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 5160d42367..6b3dc01306 100644
--- a/modules/mono/csharp_script.cpp
+++ b/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.