From 55b2e58a98697f9d65fa1dd41cd4ae8184213f43 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Thu, 23 Jan 2020 21:23:32 +0100 Subject: Mono/C#: Lighten up unsafe reference checks Because of the weird case with multi-threading and ResourceLoader, it can be the case that a resource is GCed while being referenced again in the main thread. In such cases, a new unsafe reference is created before the finalizer thread removes the previous one. --- modules/mono/csharp_script.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/mono/csharp_script.h') diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 30f56e00bd..f244bc4119 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -308,8 +308,9 @@ class CSharpLanguage : public ScriptLanguage { Map script_bindings; #ifdef DEBUG_ENABLED - // List of unsafely referenced objects - List unsafely_referenced_objects; + // List of unsafe object references + Map unsafe_object_references; + Mutex *unsafe_object_references_lock; #endif struct StringNameCache { -- cgit v1.2.3