]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-46417: Py_Finalize() clears static types (GH-30743)
authorVictor Stinner <vstinner@python.org>
Fri, 21 Jan 2022 12:06:34 +0000 (13:06 +0100)
committerGitHub <noreply@github.com>
Fri, 21 Jan 2022 12:06:34 +0000 (13:06 +0100)
commit595225e86dcc6ea520a584839925a878dce7a9b2
tree177f9801d750c91f61ae40b99b9dcf8b0e9c135d
parentea38e436fe1e585fb8c1f0badf5482f525b7f9ff
bpo-46417: Py_Finalize() clears static types (GH-30743)

Add _PyTypes_FiniTypes() best-effort function to clear static types:
don't deallocate a type if it still has subclasses.

remove_subclass() now sets tp_subclasses to NULL when removing the
last subclass.
Include/internal/pycore_typeobject.h
Objects/object.c
Objects/typeobject.c
Python/pylifecycle.c