summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher L. Farrow <cfarrow@enthought.com>2011-08-05 20:43:10 -0500
committerCharles Harris <charlesr.harris@gmail.com>2011-10-02 09:09:39 -0600
commit3a7e61c7d55be9a84929747c38cd71e62593129d (patch)
tree51c33c56a152993e23a3c645ac4fcbab430b54b2
parentbe52978667fd10d26c9c0013385513eaece78dd3 (diff)
downloadnumpy-3a7e61c7d55be9a84929747c38cd71e62593129d.tar.gz
BUG: Fixed reference count bug where scalar value assignment by field to an array would increment the reference count of the scalar.
-rw-r--r--numpy/core/src/multiarray/arrayobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c
index 2e69b25f6..145daa845 100644
--- a/numpy/core/src/multiarray/arrayobject.c
+++ b/numpy/core/src/multiarray/arrayobject.c
@@ -243,6 +243,7 @@ PyArray_CopyObject(PyArrayObject *dest, PyObject *src_object)
else {
if (PyArray_SIZE(dest) == 1) {
Py_DECREF(dtype);
+ Py_DECREF(src_object);
ret = PyArray_DESCR(dest)->f->setitem(src_object,
PyArray_DATA(dest), dest);
/* Unmask the value if necessary */