From d515fcc47afe2f1647120ef974b35cb56ff7bfc5 Mon Sep 17 00:00:00 2001 From: RedworkDE <10944644+RedworkDE@users.noreply.github.com> Date: Mon, 12 Jun 2023 21:59:48 +0200 Subject: C#: Fix crash with `DisposablesTracker_OnGodotShuttingDown` --- modules/mono/csharp_script.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/mono/csharp_script.cpp') 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 -- cgit v1.2.3