mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
bpo-36854: Fix refleak in subinterpreter (GH-17331)
finalize_interp_clear() now explicitly clears the codec registry and then trigger a GC collection to clear all references.
This commit is contained in:
parent
91daa9d722
commit
310e2d2517
2 changed files with 13 additions and 2 deletions
|
|
@ -6721,11 +6721,14 @@ PyInit__testcapi(void)
|
|||
PyModule_AddObject(m, "instancemethod", (PyObject *)&PyInstanceMethod_Type);
|
||||
|
||||
PyModule_AddIntConstant(m, "the_number_three", 3);
|
||||
PyObject *v;
|
||||
#ifdef WITH_PYMALLOC
|
||||
PyModule_AddObject(m, "WITH_PYMALLOC", Py_True);
|
||||
v = Py_True;
|
||||
#else
|
||||
PyModule_AddObject(m, "WITH_PYMALLOC", Py_False);
|
||||
v = Py_False;
|
||||
#endif
|
||||
Py_INCREF(v);
|
||||
PyModule_AddObject(m, "WITH_PYMALLOC", v);
|
||||
|
||||
TestError = PyErr_NewException("_testcapi.error", NULL, NULL);
|
||||
Py_INCREF(TestError);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue