diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2020-06-13 17:47:38 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-13 17:47:38 -0600 |
commit | cb98ad400c701f189d4e4043ee2cb44857733df4 (patch) | |
tree | 4fd7fe2994391f04149c09bc34f587062e40bc90 | |
parent | ccb971d169e75c35ae0360e0949f31d2c0c49107 (diff) | |
parent | 74647b34dbf83929a3e66bddfc376c4a53705689 (diff) | |
download | numpy-cb98ad400c701f189d4e4043ee2cb44857733df4.tar.gz |
Merge pull request #16596 from seberg/indexing-ref-leak
BUG: Fix reference count leak in mapping.c
-rw-r--r-- | numpy/core/src/multiarray/mapping.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c index 7aefbfc38..f73cb48d9 100644 --- a/numpy/core/src/multiarray/mapping.c +++ b/numpy/core/src/multiarray/mapping.c @@ -2480,8 +2480,6 @@ PyArray_MapIterCheckIndices(PyArrayMapIterObject *mit) int i; NPY_BEGIN_THREADS_DEF; - intp_type = PyArray_DescrFromType(NPY_INTP); - if (NpyIter_GetIterSize(mit->outer) == 0) { /* * When the outer iteration is empty, the indices broadcast to an @@ -2493,6 +2491,8 @@ PyArray_MapIterCheckIndices(PyArrayMapIterObject *mit) return 0; } + intp_type = PyArray_DescrFromType(NPY_INTP); + NPY_BEGIN_THREADS; for (i=0; i < mit->numiter; i++) { |