summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-08-13 07:23:58 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-08-13 07:23:58 +0000
commit8e24ef871ee8a58ae65d4d59d8ac916a48568c56 (patch)
tree54418ced26c51b15beec52967abdad93ddb3f787
parent01a0309eca710b4128df2c9b5ce3a6905281df4b (diff)
downloadnumpy-8e24ef871ee8a58ae65d4d59d8ac916a48568c56.tar.gz
Fix ticket #243
-rw-r--r--numpy/core/src/multiarraymodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c
index ed4f00036..9a219ca3e 100644
--- a/numpy/core/src/multiarraymodule.c
+++ b/numpy/core/src/multiarraymodule.c
@@ -295,6 +295,7 @@ PyArray_Round(PyArrayObject *a, int decimals, PyArrayObject *out)
PyArray_ISFORTRAN(a));
if (out == NULL) return NULL;
}
+ else Py_INCREF(out);
f = PyFloat_FromDouble(power_of_ten(decimals));
if (f==NULL) return NULL;
ret = PyObject_CallFunction(op1, "OOO", a, f, out);
@@ -308,6 +309,7 @@ PyArray_Round(PyArrayObject *a, int decimals, PyArrayObject *out)
finish:
Py_DECREF(f);
+ Py_DECREF(out);
return ret;
}