Browse Source
bpo-41796: Call _PyAST_Fini() earlier to fix a leak (GH-23131)
bpo-41796: Call _PyAST_Fini() earlier to fix a leak (GH-23131)
Call _PyAST_Fini() on all interpreters, not only on the main interpreter. Also, call it ealier to fix a reference leak. Python types contain a reference to themselves in in their PyTypeObject.tp_mro member. _PyAST_Fini() must called before the last GC collection to destroy AST types. _PyInterpreterState_Clear() now calls _PyAST_Fini(). It now also calls _PyWarnings_Fini() on subinterpeters, not only on the main interpreter. Add an assertion in AST init_types() to ensure that the _ast module is no longer used after _PyAST_Fini() has been called.pull/23133/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 79 additions and 44 deletions
-
2Include/internal/pycore_pylifecycle.h
-
69Parser/asdl_c.py
-
33Python/Python-ast.c
-
8Python/pylifecycle.c
-
11Python/pystate.c
Write
Preview
Loading…
Cancel
Save
Reference in new issue