]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40170: Fix PyType_Ready() refleak on static type (GH-23236)
authorVictor Stinner <vstinner@python.org>
Wed, 11 Nov 2020 13:27:32 +0000 (14:27 +0100)
committerGitHub <noreply@github.com>
Wed, 11 Nov 2020 13:27:32 +0000 (14:27 +0100)
commitba2958ed40d284228836735cbed4a155190e0998
tree8266560eea9bd2d980e9f19196703d0dfcfb8513
parentf9a8386e44a695551a1e54e709969e90e9b96bc4
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).
Include/cpython/object.h
Objects/typeobject.c