summaryrefslogtreecommitdiffstats
path: root/modules/mono/mono_gc_handle.cpp
diff options
context:
space:
mode:
authorIgnacio Roldán Etcheverry <ignalfonsore@gmail.com>2021-09-12 20:23:05 +0200
committerIgnacio Roldán Etcheverry <ignalfonsore@gmail.com>2022-08-22 03:35:59 +0200
commitf9a67ee9da1d6cc3562fa5a7443a2a66a673bd8c (patch)
tree724e3b0a0030cc0abc67710dcf9c4a14be5724f0 /modules/mono/mono_gc_handle.cpp
parent513ee857a938c466e0f7146f66db771b9c6e2024 (diff)
downloadredot-engine-f9a67ee9da1d6cc3562fa5a7443a2a66a673bd8c.tar.gz
C#: Begin move to .NET Core
We're targeting .NET 5 for now to make development easier while .NET 6 is not yet released. TEMPORARY REGRESSIONS --------------------- Assembly unloading is not implemented yet. As such, many Godot resources are leaked at exit. This will be re-implemented later together with assembly hot-reloading.
Diffstat (limited to 'modules/mono/mono_gc_handle.cpp')
-rw-r--r--modules/mono/mono_gc_handle.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/modules/mono/mono_gc_handle.cpp b/modules/mono/mono_gc_handle.cpp
index f0a48483f6..9cf0a641b9 100644
--- a/modules/mono/mono_gc_handle.cpp
+++ b/modules/mono/mono_gc_handle.cpp
@@ -38,17 +38,13 @@ void MonoGCHandleData::release() {
CRASH_COND(handle.value && GDMono::get_singleton() == nullptr);
#endif
- if (handle.value && !GDMonoCache::cached_data.methodthunk_GCHandleBridge_FreeGCHandle.is_null() &&
+ if (handle.value && GDMonoCache::godot_api_cache_updated &&
GDMono::get_singleton()->is_runtime_initialized()) {
free_gchandle(handle);
handle.value = nullptr;
}
}
void MonoGCHandleData::free_gchandle(GCHandleIntPtr p_gchandle) {
- CRASH_COND(GDMonoCache::cached_data.methodthunk_GCHandleBridge_FreeGCHandle.is_null());
- MonoException *exc = nullptr;
- GDMonoCache::cached_data.methodthunk_GCHandleBridge_FreeGCHandle.invoke(p_gchandle, &exc);
- if (exc) {
- GDMonoUtils::debug_unhandled_exception(exc);
- }
+ CRASH_COND(!GDMonoCache::godot_api_cache_updated);
+ GDMonoCache::managed_callbacks.GCHandleBridge_FreeGCHandle(p_gchandle);
}