[Numpy-svn] r3443 - in trunk/numpy/core: blasdot src
numpy-svn at scipy.org
numpy-svn at scipy.org
Fri Nov 17 13:45:19 EST 2006
Author: oliphant
Date: 2006-11-17 12:45:17 -0600 (Fri, 17 Nov 2006)
New Revision: 3443
Modified:
trunk/numpy/core/blasdot/_dotblas.c
trunk/numpy/core/src/arrayobject.c
Log:
Fix reference count problem with dtypes in vdot
Modified: trunk/numpy/core/blasdot/_dotblas.c
===================================================================
--- trunk/numpy/core/blasdot/_dotblas.c 2006-11-17 11:01:35 UTC (rev 3442)
+++ trunk/numpy/core/blasdot/_dotblas.c 2006-11-17 18:45:17 UTC (rev 3443)
@@ -979,11 +979,11 @@
typenum = PyArray_ObjectType(op2, typenum);
type = PyArray_DescrFromType(typenum);
-
+ Py_INCREF(type);
ap1 = (PyArrayObject *)PyArray_FromAny(op1, type, 0, 0, 0, NULL);
- if (ap1==NULL) goto fail;
+ if (ap1==NULL) {Py_DECREF(type); goto fail;}
op1 = PyArray_Flatten(ap1, 0);
- if (op1==NULL) goto fail;
+ if (op1==NULL) {Py_DECREF(type); goto fail;}
Py_DECREF(ap1);
ap1 = (PyArrayObject *)op1;
Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c 2006-11-17 11:01:35 UTC (rev 3442)
+++ trunk/numpy/core/src/arrayobject.c 2006-11-17 18:45:17 UTC (rev 3443)
@@ -10614,6 +10614,7 @@
"an attempt was made to deallocate %d (%c) ***\n",
self->type_num, self->type);
Py_INCREF(self);
+ Py_INCREF(self);
return;
}
Py_XDECREF(self->typeobj);
More information about the Numpy-svn
mailing list