Skip to content

Commit e6efa2f

Browse files
committed
fixed missing BorrowedReference.DangerousIncRefOrNull
1 parent def4d0a commit e6efa2f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/runtime/methodbinding.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ public static IntPtr tp_getattro(IntPtr ob, IntPtr key)
145145
{
146146
return Runtime.PyObject_GenericGetAttr(ob, key);
147147
}
148-
return sig.Reference.DangerousIncRefOrNull();
148+
return sig.Reference.IsNull
149+
? IntPtr.Zero
150+
: Runtime.SelfIncRef(sig.Reference.DangerousGetAddress());
149151
case "__name__":
150152
var pyName = self.m.GetName();
151153
return pyName == IntPtr.Zero

0 commit comments

Comments
 (0)