mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
bpo-46417: Finalize structseq types at exit (GH-30645)
Add _PyStructSequence_FiniType() and _PyStaticType_Dealloc() functions to finalize a structseq static type in Py_Finalize(). Currrently, these functions do nothing if Python is built in release mode. Clear static types: * AsyncGenHooksType: sys.set_asyncgen_hooks() * FlagsType: sys.flags * FloatInfoType: sys.float_info * Hash_InfoType: sys.hash_info * Int_InfoType: sys.int_info * ThreadInfoType: sys.thread_info * UnraisableHookArgsType: sys.unraisablehook * VersionInfoType: sys.version * WindowsVersionType: sys.getwindowsversion()
This commit is contained in:
parent
27df7566bc
commit
e9e3eab0b8
17 changed files with 230 additions and 2 deletions
|
@ -1666,11 +1666,17 @@ flush_std_files(void)
|
|||
static void
|
||||
finalize_interp_types(PyInterpreterState *interp)
|
||||
{
|
||||
_PySys_Fini(interp);
|
||||
_PyExc_Fini(interp);
|
||||
_PyFrame_Fini(interp);
|
||||
_PyAsyncGen_Fini(interp);
|
||||
_PyContext_Fini(interp);
|
||||
_PyFloat_FiniType(interp);
|
||||
_PyLong_FiniTypes(interp);
|
||||
_PyThread_FiniType(interp);
|
||||
_PyErr_FiniTypes(interp);
|
||||
_PyTypes_Fini(interp);
|
||||
|
||||
// Call _PyUnicode_ClearInterned() before _PyDict_Fini() since it uses
|
||||
// a dict internally.
|
||||
_PyUnicode_ClearInterned(interp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue