summaryrefslogtreecommitdiffstats
path: root/modules/mono/csharp_script.cpp
diff options
context:
space:
mode:
authorRedworkDE <10944644+RedworkDE@users.noreply.github.com>2023-06-12 21:59:48 +0200
committerRedworkDE <10944644+RedworkDE@users.noreply.github.com>2023-06-13 07:49:21 +0200
commitd515fcc47afe2f1647120ef974b35cb56ff7bfc5 (patch)
treecbd176c8bb134b58c974907340731c38157098c0 /modules/mono/csharp_script.cpp
parenta3c49ad2f0120f41789836a523698db0d4a9f0f2 (diff)
downloadredot-engine-d515fcc47afe2f1647120ef974b35cb56ff7bfc5.tar.gz
C#: Fix crash with `DisposablesTracker_OnGodotShuttingDown`
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r--modules/mono/csharp_script.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 05595e7e45..e06440230b 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -139,6 +139,10 @@ void CSharpLanguage::finalize() {
return;
}
+ if (gdmono && gdmono->is_runtime_initialized() && GDMonoCache::godot_api_cache_updated) {
+ GDMonoCache::managed_callbacks.DisposablesTracker_OnGodotShuttingDown();
+ }
+
finalizing = true;
// Make sure all script binding gchandles are released before finalizing GDMono