mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
Issue #4838: When a module is deallocated, free the memory backing the optional module state data.
This commit is contained in:
parent
0c3f8a4800
commit
e4bc7f69c2
2 changed files with 5 additions and 0 deletions
|
|
@ -12,6 +12,9 @@ What's New in Python 3.1 alpha 0
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #4838: When a module is deallocated, free the memory backing the
|
||||||
|
optional module state data.
|
||||||
|
|
||||||
- Issue #4910: Rename nb_long slot to nb_reserved, and change its
|
- Issue #4910: Rename nb_long slot to nb_reserved, and change its
|
||||||
type to (void *).
|
type to (void *).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -315,6 +315,8 @@ module_dealloc(PyModuleObject *m)
|
||||||
_PyModule_Clear((PyObject *)m);
|
_PyModule_Clear((PyObject *)m);
|
||||||
Py_DECREF(m->md_dict);
|
Py_DECREF(m->md_dict);
|
||||||
}
|
}
|
||||||
|
if (m->md_state != NULL)
|
||||||
|
PyMem_FREE(m->md_state);
|
||||||
Py_TYPE(m)->tp_free((PyObject *)m);
|
Py_TYPE(m)->tp_free((PyObject *)m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue