]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 68669 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 17 Jan 2009 21:40:04 +0000 (21:40 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 17 Jan 2009 21:40:04 +0000 (21:40 +0000)
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.
........

Misc/NEWS
Objects/moduleobject.c

index 1bd6c05083e896c51ebd8e819c1c7a4164dcc8b5..43ab22426f3f6f7bf799d0d7c294530f2daad50e 100644 (file)
--- 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 *).
 
index 9c705b888d25e25a8d223db41b69237a36531f67..0c6032fbe85941ee4aa60ee96d6638598abdb7d6 100644 (file)
@@ -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);
 }