- del func.func_defaults raises a TypeError instead of dumping core
+- #121013 - stringobject.c -- "".join(u"this is a test") dumped core
+
+- exceptions.c - make_class() Added a "goto finally" so that if
+ populate_methods() fails, the return status will be -1 (failure)
+ instead of 0 (success).
+
+ fini_exceptions(): When decref'ing the static pointers to the
+ exception classes, clear out their dictionaries too. This breaks a
+ cycle from class->dict->method->class and allows the classes with
+ unbound methods to be reclaimed. This plugs a large memory leak in a
+ common Py_Initialize()/dosomething/Py_Finalize() loop.
+
What's New in Python 2.0?
=========================
if (populate_methods(*klass, dict, methods)) {
Py_DECREF(*klass);
*klass = NULL;
+ goto finally;
}
status = 0;
PyExc_MemoryErrorInst = NULL;
for (i=0; exctable[i].name; i++) {
+ /* clear the class's dictionary, freeing up circular references
+ * between the class and its methods.
+ */
+ PyObject* cdict = PyObject_GetAttrString(*exctable[i].exc, "__dict__");
+ PyDict_Clear(cdict);
+ Py_DECREF(cdict);
+
+ /* Now decref the exception class */
Py_XDECREF(*exctable[i].exc);
*exctable[i].exc = NULL;
}