summaryrefslogtreecommitdiffstats
path: root/modules/mono/csharp_script.h
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2020-01-23 21:23:32 +0100
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2020-01-23 21:23:32 +0100
commit55b2e58a98697f9d65fa1dd41cd4ae8184213f43 (patch)
treef3c3dac54a0437a807d3de30da3a6b69519b8527 /modules/mono/csharp_script.h
parent1c0995d4509acd0a750f32517b14c01842220cca (diff)
downloadredot-engine-55b2e58a98697f9d65fa1dd41cd4ae8184213f43.tar.gz
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.
Diffstat (limited to 'modules/mono/csharp_script.h')
-rw-r--r--modules/mono/csharp_script.h5
1 files changed, 3 insertions, 2 deletions
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<Object *, CSharpScriptBinding> script_bindings;
#ifdef DEBUG_ENABLED
- // List of unsafely referenced objects
- List<ObjectID> unsafely_referenced_objects;
+ // List of unsafe object references
+ Map<ObjectID, int> unsafe_object_references;
+ Mutex *unsafe_object_references_lock;
#endif
struct StringNameCache {