bpo-40170: Fix PyType_Ready() refleak on static type (GH-23236) · python/cpython@ba2958e · GitHub
Skip to content

Commit ba2958e

Browse files
authored
bpo-40170: Fix PyType_Ready() refleak on static type (GH-23236)
bpo-1635741, bpo-40170: When called on a static type with NULL tp_base, PyType_Ready() no longer increments the reference count of the PyBaseObject_Type ("object). PyTypeObject.tp_base is a strong reference on a heap type, but it is borrowed reference on a static type. Fix 99 reference leaks at Python exit (showrefcount 18623 => 18524).
1 parent f9a8386 commit ba2958e

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Include/cpython/object.h

Lines changed: 1 addition & 0 deletions

Objects/typeobject.c

Lines changed: 7 additions & 2 deletions

0 commit comments

Comments
 (0)