Commit 05e744dc authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Fix segfault problem with recent numpy.pxd/Python 2.4 patch

parent 28baecd5
...@@ -187,6 +187,7 @@ cdef extern from "numpy/arrayobject.h": ...@@ -187,6 +187,7 @@ cdef extern from "numpy/arrayobject.h":
def __releasebuffer__(ndarray self, Py_buffer* info): def __releasebuffer__(ndarray self, Py_buffer* info):
# This can not be called unless format needs to be freed (as # This can not be called unless format needs to be freed (as
# obj is set to NULL in those case) # obj is set to NULL in those case)
if PyArray_HASFIELDS(self):
stdlib.free(info.format) stdlib.free(info.format)
if sizeof(npy_intp) != sizeof(Py_ssize_t): if sizeof(npy_intp) != sizeof(Py_ssize_t):
stdlib.free(info.strides) stdlib.free(info.strides)
...@@ -201,7 +202,7 @@ cdef extern from "numpy/arrayobject.h": ...@@ -201,7 +202,7 @@ cdef extern from "numpy/arrayobject.h":
cdef npy_intp* PyArray_DIMS(ndarray arr) cdef npy_intp* PyArray_DIMS(ndarray arr)
cdef int PyArray_ITEMSIZE(ndarray arr) cdef int PyArray_ITEMSIZE(ndarray arr)
cdef int PyArray_CHKFLAGS(ndarray arr, int flags) cdef int PyArray_CHKFLAGS(ndarray arr, int flags)
cdef int PyArray_HASFIELDS(ndarray arr, int flags) cdef int PyArray_HASFIELDS(ndarray arr)
cdef int PyDataType_HASFIELDS(dtype obj) cdef int PyDataType_HASFIELDS(dtype obj)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment