summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-01-17 21:40:04 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2009-01-17 21:40:04 +0000
commitf0b20a7ffcc6a941a103ad75d5c959c44710a17f (patch)
treed1dd81db3ac26de07a35f9b163a39dc4b2cb518c
parentd9a1c5611bb7284da35bdbf4e3f039c95181669d (diff)
downloadcpython-git-f0b20a7ffcc6a941a103ad75d5c959c44710a17f.tar.gz
Merged revisions 68669 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r68669 | antoine.pitrou | 2009-01-17 22:06:43 +0100 (sam., 17 janv. 2009) | 3 lines Issue #4838: When a module is deallocated, free the memory backing the optional module state data. ........
-rw-r--r--Misc/NEWS3
-rw-r--r--Objects/moduleobject.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 1bd6c05083..43ab22426f 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 3.0.1?
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
type to (void *).
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 9c705b888d..0c6032fbe8 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -315,6 +315,8 @@ module_dealloc(PyModuleObject *m)
_PyModule_Clear((PyObject *)m);
Py_DECREF(m->md_dict);
}
+ if (m->md_state != NULL)
+ PyMem_FREE(m->md_state);
Py_TYPE(m)->tp_free((PyObject *)m);
}