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
|
@ -7464,6 +7464,12 @@ pickle_clear(PyObject *m)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
pickle_free(PyObject *m)
|
||||
{
|
||||
_Pickle_ClearState(_Pickle_GetState(m));
|
||||
}
|
||||
|
||||
static int
|
||||
pickle_traverse(PyObject *m, visitproc visit, void *arg)
|
||||
{
|
||||
|
@ -7492,7 +7498,7 @@ static struct PyModuleDef _picklemodule = {
|
|||
NULL, /* m_reload */
|
||||
pickle_traverse, /* m_traverse */
|
||||
pickle_clear, /* m_clear */
|
||||
NULL /* m_free */
|
||||
(freefunc)pickle_free /* m_free */
|
||||
};
|
||||
|
||||
PyMODINIT_FUNC
|
||||
|
|
Loading…
Reference in New Issue