Author: amaury.forgeotdarc
Date: Thu Nov 15 20:16:08 2007
New Revision: 58986
Modified:
python/branches/py3k/Objects/object.c
python/branches/py3k/Objects/rangeobject.c
Log:
Correct a memory leak: the range() object was not properly freed.
Modified: python/branches/py3k/Objects/object.c
==============================================================================
--- python/branches/py3k/Objects/object.c (original)
+++ python/branches/py3k/Objects/object.c Thu Nov 15 20:16:08 2007
@@ -1509,6 +1509,9 @@
if (PyType_Ready(&PyStdPrinter_Type) < 0)
Py_FatalError("Can't initialize StdPrinter");
+
+ if (PyType_Ready(&PyRange_Type) < 0)
+ Py_FatalError("Can't initialize 'range'");
}
Modified: python/branches/py3k/Objects/rangeobject.c
==============================================================================
--- python/branches/py3k/Objects/rangeobject.c (original)
+++ python/branches/py3k/Objects/rangeobject.c Thu Nov 15 20:16:08 2007
@@ -107,6 +107,7 @@
Py_DECREF(r->start);
Py_DECREF(r->stop);
Py_DECREF(r->step);
+ Py_Type(r)->tp_free(r);
}
/* Return number of items in range (lo, hi, step), when arguments are
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins