@@ -285,22 +285,22 @@ public static NewReference mp_subscript(BorrowedReference tp, BorrowedReference
285
285
/// Dealloc implementation. This is called when a Python type generated
286
286
/// by this metatype is no longer referenced from the Python runtime.
287
287
/// </summary>
288
- public static void tp_dealloc ( NewReference tp )
288
+ public static void tp_dealloc ( NewReference lastRef )
289
289
{
290
290
// Fix this when we dont cheat on the handle for subclasses!
291
291
292
- var flags = ( TypeFlags ) Util . ReadCLong ( tp . Borrow ( ) , TypeOffset . tp_flags ) ;
292
+ var flags = ( TypeFlags ) Util . ReadCLong ( lastRef . Borrow ( ) , TypeOffset . tp_flags ) ;
293
293
if ( ( flags & TypeFlags . Subclass ) == 0 )
294
294
{
295
- GetGCHandle ( tp . Borrow ( ) ) . Free ( ) ;
295
+ GetGCHandle ( lastRef . Borrow ( ) ) . Free ( ) ;
296
296
#if DEBUG
297
297
// prevent ExecutionEngineException in debug builds in case we have a bug
298
298
// this would allow using managed debugger to investigate the issue
299
- SetGCHandle ( tp . Borrow ( ) , Runtime . CLRMetaType , default ) ;
299
+ SetGCHandle ( lastRef . Borrow ( ) , Runtime . CLRMetaType , default ) ;
300
300
#endif
301
301
}
302
302
303
- var op = Util . ReadIntPtr ( tp . Borrow ( ) , TypeOffset . ob_type ) ;
303
+ var op = Util . ReadIntPtr ( lastRef . Borrow ( ) , TypeOffset . ob_type ) ;
304
304
// We must decref our type.
305
305
// type_dealloc from PyType will use it to get tp_free so we must keep the value
306
306
Runtime . XDecref ( StolenReference . DangerousFromPointer ( op ) ) ;
@@ -311,7 +311,7 @@ public static void tp_dealloc(NewReference tp)
311
311
// case our CLR metatype. That is why we implement tp_free.
312
312
313
313
IntPtr tp_dealloc = Util . ReadIntPtr ( Runtime . PyTypeType , TypeOffset . tp_dealloc ) ;
314
- NativeCall . CallDealloc ( tp_dealloc , tp . Steal ( ) ) ;
314
+ NativeCall . CallDealloc ( tp_dealloc , lastRef . Steal ( ) ) ;
315
315
}
316
316
317
317
private static NewReference DoInstanceCheck ( BorrowedReference tp , BorrowedReference args , bool checkType )
0 commit comments