Convert Runtime.Dispose to use GCHandle.

This commit is contained in:
Rolf Bjarne Kvinge 2020-05-04 11:08:35 +02:00
Родитель e2ee5a2710
Коммит cff3617dd2
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -188,7 +188,7 @@
},
new XDelegate ("void", "void", "xamarin_dispose",
"MonoObject *", "IntPtr", "mobj"
"GCHandle->MonoObject*", "IntPtr", "mobj"
) {
WrappedManagedFunction = "Dispose",
OnlyDynamicUsage = false,

Просмотреть файл

@ -712,9 +712,9 @@ namespace ObjCRuntime {
return ObjectWrapper.Convert (GetNSObject (ptr, type, MissingCtorResolution.ThrowConstructor1NotFound, true, out created));
}
static void Dispose (IntPtr mobj)
static void Dispose (IntPtr gchandle)
{
((IDisposable) ObjectWrapper.Convert (mobj)).Dispose ();
((IDisposable) GetGCHandleTarget (gchandle)).Dispose ();
}
static bool IsParameterTransient (IntPtr info, int parameter)