();
private bool _alreadyReset = false;
+ BorrowedReference Type => new BorrowedReference(_type);
+
///
/// Create slots holder for holding the delegate of slots and be able to reset them.
///
@@ -861,15 +849,18 @@ public void ResetSlots()
_deallocators.Clear();
// Custom reset
- IntPtr handlePtr = Marshal.ReadIntPtr(_type, TypeOffset.magic());
- if (handlePtr != IntPtr.Zero)
+ if (Type != Runtime.CLRMetaType)
{
- GCHandle handle = GCHandle.FromIntPtr(handlePtr);
- if (handle.IsAllocated)
+ var metatype = Runtime.PyObject_TYPE(Type);
+ if (ManagedType.TryGetGCHandle(Type, metatype) is { } handle)
{
- handle.Free();
+ if (handle.IsAllocated)
+ {
+ handle.Free();
+ }
+
+ ManagedType.SetGCHandle(Type, metatype, default);
}
- Marshal.WriteIntPtr(_type, TypeOffset.magic(), IntPtr.Zero);
}
}
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy