[Numpy-svn] r5362 - trunk/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Tue Jul 8 12:13:58 CDT 2008


Author: oliphant
Date: 2008-07-08 12:13:53 -0500 (Tue, 08 Jul 2008)
New Revision: 5362

Modified:
   trunk/numpy/core/src/scalartypes.inc.src
Log:
Fix refleake discussed in #848.  Only applied part of the patch.

Modified: trunk/numpy/core/src/scalartypes.inc.src
===================================================================
--- trunk/numpy/core/src/scalartypes.inc.src	2008-07-08 17:02:15 UTC (rev 5361)
+++ trunk/numpy/core/src/scalartypes.inc.src	2008-07-08 17:13:53 UTC (rev 5362)
@@ -1883,10 +1883,11 @@
 
     _WORK@work@
 
-        if (!PyArg_ParseTuple(args, "|O", &obj)) return NULL;
+    if (!PyArg_ParseTuple(args, "|O", &obj)) return NULL;
 
     typecode = PyArray_DescrFromType(PyArray_@TYPE@);
-    Py_INCREF(typecode);
+    /* typecode is new reference and stolen by 
+       PyArray_Scalar and others */
     if (obj == NULL) {
 #if @default@ == 0
         char *mem;



More information about the Numpy-svn mailing list