[Python-checkins] r68669 - in python/branches/py3k: Misc/NEWS Objects/moduleobject.c

antoine.pitrou python-checkins at python.org
Sat Jan 17 22:06:43 CET 2009


Author: antoine.pitrou
Date: Sat Jan 17 22:06:43 2009
New Revision: 68669

Log:
Issue #4838: When a module is deallocated, free the memory backing the optional module state data.



Modified:
   python/branches/py3k/Misc/NEWS
   python/branches/py3k/Objects/moduleobject.c

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Sat Jan 17 22:06:43 2009
@@ -12,6 +12,9 @@
 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 *).
 

Modified: python/branches/py3k/Objects/moduleobject.c
==============================================================================
--- python/branches/py3k/Objects/moduleobject.c	(original)
+++ python/branches/py3k/Objects/moduleobject.c	Sat Jan 17 22:06:43 2009
@@ -315,6 +315,8 @@
 		_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);
 }
 


More information about the Python-checkins mailing list