mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
Issue #19972: Add rarely used freefunc. This fixes a leak if sys.exit()
is used in a program.
This commit is contained in:
parent
7ab9f72519
commit
f483b0f3a9
1 changed files with 14 additions and 8 deletions
|
@ -7464,6 +7464,12 @@ pickle_clear(PyObject *m)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
pickle_free(PyObject *m)
|
||||||
|
{
|
||||||
|
_Pickle_ClearState(_Pickle_GetState(m));
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pickle_traverse(PyObject *m, visitproc visit, void *arg)
|
pickle_traverse(PyObject *m, visitproc visit, void *arg)
|
||||||
{
|
{
|
||||||
|
@ -7492,7 +7498,7 @@ static struct PyModuleDef _picklemodule = {
|
||||||
NULL, /* m_reload */
|
NULL, /* m_reload */
|
||||||
pickle_traverse, /* m_traverse */
|
pickle_traverse, /* m_traverse */
|
||||||
pickle_clear, /* m_clear */
|
pickle_clear, /* m_clear */
|
||||||
NULL /* m_free */
|
(freefunc)pickle_free /* m_free */
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMODINIT_FUNC
|
PyMODINIT_FUNC
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue