Ticket #13666: patch-Src-arrayobject.c

File patch-Src-arrayobject.c, 590 bytes (added by macports_dharland@…, 17 years ago)

Patch to arrayobject for memory leak in tolist()

Line 
1--- ./Src/arrayobject.c.orig    2005-11-11 20:30:18.000000000 +1300
2+++ ./Src/arrayobject.c 2006-03-10 17:55:59.000000000 +1300
3@@ -12,7 +12,7 @@
4   performance for heterogeneity.
5 */
6 
7-/* $Id: arrayobject.c,v 1.107 2005/11/09 19:43:39 teoliphant Exp $ */
8+/* $Id: arrayobject.c,v 1.108 2006/03/10 04:55:59 teoliphant Exp $ */
9 
10 #include "Python.h"
11 #include <stddef.h>
12@@ -1866,9 +1866,7 @@
13     for (i=0; i<sz; i++) {
14        v=array_item((PyArrayObject *)self, i);
15        PyList_SetItem(lp, i, PyArray_ToList(v));
16-       if (((PyArrayObject *)self)->nd>1){
17-           Py_DECREF(v);
18-       }
19+       Py_DECREF(v);
20     }