changeset: 100959:4680438f486f branch: 2.7 parent: 100957:125d27d9cf9b user: Serhiy Storchaka date: Wed Apr 13 15:27:33 2016 +0300 files: Misc/NEWS Objects/typeobject.c description: Issue #26718: super.__init__ no longer leaks memory if called multiple times. NOTE: A direct call of super.__init__ is not endorsed! diff -r 125d27d9cf9b -r 4680438f486f Misc/NEWS --- a/Misc/NEWS Tue Apr 12 23:13:33 2016 -0700 +++ b/Misc/NEWS Wed Apr 13 15:27:33 2016 +0300 @@ -10,6 +10,9 @@ Core and Builtins ----------------- +- Issue #26718: super.__init__ no longer leaks memory if called multiple times. + NOTE: A direct call of super.__init__ is not endorsed! + - Issue #13410: Fixed a bug in PyUnicode_Format where it failed to properly ignore errors from a __int__() method. diff -r 125d27d9cf9b -r 4680438f486f Objects/typeobject.c --- a/Objects/typeobject.c Tue Apr 12 23:13:33 2016 -0700 +++ b/Objects/typeobject.c Wed Apr 13 15:27:33 2016 +0300 @@ -6741,9 +6741,9 @@ Py_INCREF(obj); } Py_INCREF(type); - su->type = type; - su->obj = obj; - su->obj_type = obj_type; + Py_XSETREF(su->type, type); + Py_XSETREF(su->obj, obj); + Py_XSETREF(su->obj_type, obj_type); return 0; }