diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-29 13:17:56 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-29 13:17:56 +0100 |
commit | f0144d7f450d461bf8d4c026d24e490654233760 (patch) | |
tree | a2242030897728c3e2736ebb78eed30549ca52a4 /modules/mono/csharp_script.cpp | |
parent | 5c61803971a906b65cf1b61d3856b66b4737efe6 (diff) | |
parent | 9d50a486bf00592888664828b35d703c46eaa9b0 (diff) | |
download | redot-engine-f0144d7f450d461bf8d4c026d24e490654233760.tar.gz |
Merge pull request #87669 from bs-mwoerner/csharp_deadlock
Fix possible deadlock when creating scripts during a background garbage collection
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r-- | modules/mono/csharp_script.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 33fef2d58c..a84febb226 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -2855,15 +2855,17 @@ CSharpScript::CSharpScript() { #ifdef DEBUG_ENABLED { MutexLock lock(CSharpLanguage::get_singleton()->script_instances_mutex); - CSharpLanguage::get_singleton()->script_list.add(&this->script_list); + CSharpLanguage::get_singleton()->script_list.add(&script_list); } #endif } CSharpScript::~CSharpScript() { #ifdef DEBUG_ENABLED - MutexLock lock(CSharpLanguage::get_singleton()->script_instances_mutex); - CSharpLanguage::get_singleton()->script_list.remove(&this->script_list); + { + MutexLock lock(CSharpLanguage::get_singleton()->script_instances_mutex); + CSharpLanguage::get_singleton()->script_list.remove(&script_list); + } #endif if (GDMonoCache::godot_api_cache_updated) { |