Ignore:
Timestamp:
Mar 31, 2019, 11:12:40 PM (4 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink
Children:
76b6dd3
Parents:
08246ee (diff), f55630c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into feature/autosink

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-source.c

    r08246ee r1dfe409  
    582582    } else if (PyLong_AsLong(size) > 0) {
    583583      // short read, return a shorter array
    584       PyArrayObject *shortread = (PyArrayObject*)PyTuple_GetItem(done, 0);
     584      PyObject *vec = PyTuple_GetItem(done, 0);
     585      // take a copy to prevent resizing internal arrays
     586      PyArrayObject *shortread = (PyArrayObject*)PyArray_FROM_OTF(vec,
     587          NPY_NOTYPE, NPY_ARRAY_ENSURECOPY);
    585588      PyArray_Dims newdims;
    586589      PyObject *reshaped;
     
    595598      reshaped = PyArray_Newshape(shortread, &newdims, NPY_CORDER);
    596599      Py_DECREF(shortread);
     600      Py_DECREF(vec);
    597601      return reshaped;
    598602    } else {
Note: See TracChangeset for help on using the changeset viewer.