diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 3678a82bee2..0f6b8357b86 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -559,6 +559,7 @@ Vector CSharpLanguage::debug_get_current_stack_info() #ifdef DEBUG_ENABLED _TLS_RECURSION_GUARD_V_(Vector()); + GD_MONO_SCOPE_THREAD_ATTACH; if (!gdmono->is_runtime_initialized() || !GDMono::get_singleton()->get_core_api_assembly() || !GDMonoCache::cached_data.corlib_cache_updated) return Vector(); @@ -583,6 +584,7 @@ Vector CSharpLanguage::debug_get_current_stack_info() Vector CSharpLanguage::stack_trace_get_info(MonoObject *p_stack_trace) { _TLS_RECURSION_GUARD_V_(Vector()); + GD_MONO_SCOPE_THREAD_ATTACH; MonoException *exc = NULL; @@ -689,6 +691,7 @@ void CSharpLanguage::reload_all_scripts() { #ifdef GD_MONO_HOT_RELOAD if (is_assembly_reloading_needed()) { + GD_MONO_SCOPE_THREAD_ATTACH; reload_assemblies(false); } #endif @@ -706,6 +709,7 @@ void CSharpLanguage::reload_tool_script(const Ref