Visitar URL original
Fix targetType ownership bug · pythonnet/pythonnet@e205ad0 · GitHub
Skip to content

Commit e205ad0

Browse files
committed
Fix targetType ownership bug
1 parent b363c7b commit e205ad0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/runtime/Types/MethodObject.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public static NewReference tp_descr_get(BorrowedReference ds, BorrowedReference
197197
&& self.type.Value.IsInstanceOfType(obj.inst))
198198
{
199199
var basecls = ReflectedClrType.GetOrCreate(self.type.Value);
200-
return new MethodBinding(self, new PyObject(ob), basecls).Alloc();
200+
return new MethodBinding(self, new PyObject(ob), basecls.NewReference()).Alloc();
201201
}
202202

203203
return new MethodBinding(self, target: new PyObject(ob), targetType: new PyType(tp)).Alloc();

0 commit comments

Comments
 (0)