mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-41162: Clear audit hooks later during finalization (GH-21222)
Co-authored-by: Konge <zkonge@outlook.com>
This commit is contained in:
parent
1c776541a8
commit
e1d4fdc533
5 changed files with 16 additions and 45 deletions
|
@ -1303,6 +1303,13 @@ finalize_interp_clear(PyThreadState *tstate)
|
|||
|
||||
finalize_interp_types(tstate, is_main_interp);
|
||||
|
||||
/* Clear all loghooks */
|
||||
/* Both _PySys_Audit function and users still need PyObject, such as tuple.
|
||||
Call _PySys_ClearAuditHooks when PyObject available. */
|
||||
if (is_main_interp) {
|
||||
_PySys_ClearAuditHooks(tstate);
|
||||
}
|
||||
|
||||
if (is_main_interp) {
|
||||
/* XXX Still allocated:
|
||||
- various static ad-hoc pointers to interned strings
|
||||
|
@ -1419,9 +1426,6 @@ Py_FinalizeEx(void)
|
|||
*/
|
||||
_PyGC_CollectIfEnabled();
|
||||
|
||||
/* Clear all loghooks */
|
||||
_PySys_ClearAuditHooks(tstate);
|
||||
|
||||
/* Destroy all modules */
|
||||
_PyImport_Cleanup(tstate);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue