From dd7278c4eae8f7fe221cf3d00296afda30b292ed Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 4 May 2020 11:08:42 +0200 Subject: [PATCH] Convert Runtime.RegisterEntryAssembly to use GCHandle. --- runtime/delegates.t4 | 2 +- src/ObjCRuntime/Runtime.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/delegates.t4 b/runtime/delegates.t4 index d681c77238..46033fdd96 100644 --- a/runtime/delegates.t4 +++ b/runtime/delegates.t4 @@ -83,7 +83,7 @@ }, new XDelegate ("void", "void", "xamarin_register_entry_assembly", - "MonoReflectionAssembly *", "IntPtr", "assembly" + "GCHandle->MonoReflectionAssembly *", "IntPtr", "assembly" ) { WrappedManagedFunction = "RegisterEntryAssembly", OnlyDynamicUsage = true, diff --git a/src/ObjCRuntime/Runtime.cs b/src/ObjCRuntime/Runtime.cs index 32d2e26956..41dcd70d9e 100644 --- a/src/ObjCRuntime/Runtime.cs +++ b/src/ObjCRuntime/Runtime.cs @@ -402,7 +402,7 @@ namespace ObjCRuntime { static void RegisterEntryAssembly (IntPtr a) { - RegisterEntryAssembly ((Assembly) ObjectWrapper.Convert (a)); + RegisterEntryAssembly ((Assembly) GetGCHandleTarget (a)); } static void ThrowNSException (IntPtr ns_exception)