mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
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.
This commit is contained in:
parent
ea38e436fe
commit
595225e86d
4 changed files with 144 additions and 85 deletions
|
@ -1676,6 +1676,7 @@ finalize_interp_types(PyInterpreterState *interp)
|
|||
_PyThread_FiniType(interp);
|
||||
_PyErr_FiniTypes(interp);
|
||||
_PyTypes_Fini(interp);
|
||||
_PyTypes_FiniTypes(interp);
|
||||
|
||||
// Call _PyUnicode_ClearInterned() before _PyDict_Fini() since it uses
|
||||
// a dict internally.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue