diff options
Diffstat (limited to 'modules/mono/managed_callable.cpp')
-rw-r--r-- | modules/mono/managed_callable.cpp | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/modules/mono/managed_callable.cpp b/modules/mono/managed_callable.cpp index e01d0c6e18..a1f94aa590 100644 --- a/modules/mono/managed_callable.cpp +++ b/modules/mono/managed_callable.cpp @@ -32,7 +32,6 @@ #include "csharp_script.h" #include "mono_gd/gd_mono_cache.h" -#include "mono_gd/gd_mono_utils.h" #ifdef GD_MONO_HOT_RELOAD SelfList<ManagedCallable>::List ManagedCallable::instances; @@ -52,12 +51,8 @@ bool ManagedCallable::compare_equal(const CallableCustom *p_a, const CallableCus } // Call Delegate's 'Equals' - MonoException *exc = nullptr; - MonoBoolean res = GDMonoCache::cached_data.methodthunk_DelegateUtils_DelegateEquals - .invoke(a->delegate_handle, - b->delegate_handle, &exc); - UNHANDLED_EXCEPTION(exc); - return (bool)res; + return GDMonoCache::managed_callbacks.DelegateUtils_DelegateEquals( + a->delegate_handle, b->delegate_handle); } bool ManagedCallable::compare_less(const CallableCustom *p_a, const CallableCustom *p_b) { @@ -92,27 +87,15 @@ void ManagedCallable::call(const Variant **p_arguments, int p_argcount, Variant r_call_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; // Can't find anything better r_return_value = Variant(); - MonoException *exc = nullptr; - GDMonoCache::cached_data.methodthunk_DelegateUtils_InvokeWithVariantArgs - .invoke(delegate_handle, p_arguments, - p_argcount, &r_return_value, &exc); + GDMonoCache::managed_callbacks.DelegateUtils_InvokeWithVariantArgs( + delegate_handle, p_arguments, p_argcount, &r_return_value); - if (exc) { - GDMonoUtils::set_pending_exception(exc); - } else { - r_call_error.error = Callable::CallError::CALL_OK; - } + r_call_error.error = Callable::CallError::CALL_OK; } void ManagedCallable::release_delegate_handle() { if (delegate_handle.value) { - MonoException *exc = nullptr; - GDMonoCache::cached_data.methodthunk_GCHandleBridge_FreeGCHandle.invoke(delegate_handle, &exc); - - if (exc) { - GDMonoUtils::debug_print_unhandled_exception(exc); - } - + GDMonoCache::managed_callbacks.GCHandleBridge_FreeGCHandle(delegate_handle); delegate_handle = GCHandleIntPtr(); } } |