cython
changeset 1330:991df2fe12e6
Fix segfault problem with recent numpy.pxd/Python 2.4 patch
| author | Dag Sverre Seljebotn <dagss@student.matnat.uio.no> |
|---|---|
| date | Mon Nov 10 14:13:36 2008 +0100 (4 years ago) |
| parents | e8388b451d86 |
| children | fa14f80b335c |
| files | Cython/Includes/numpy.pxd |
line diff
1.1 --- a/Cython/Includes/numpy.pxd Mon Nov 10 13:37:08 2008 +0100
1.2 +++ b/Cython/Includes/numpy.pxd Mon Nov 10 14:13:36 2008 +0100
1.3 @@ -187,7 +187,8 @@
1.4 def __releasebuffer__(ndarray self, Py_buffer* info):
1.5 # This can not be called unless format needs to be freed (as
1.6 # obj is set to NULL in those case)
1.7 - stdlib.free(info.format)
1.8 + if PyArray_HASFIELDS(self):
1.9 + stdlib.free(info.format)
1.10 if sizeof(npy_intp) != sizeof(Py_ssize_t):
1.11 stdlib.free(info.strides)
1.12 # info.shape was stored after info.strides in the same block
1.13 @@ -201,7 +202,7 @@
1.14 cdef npy_intp* PyArray_DIMS(ndarray arr)
1.15 cdef int PyArray_ITEMSIZE(ndarray arr)
1.16 cdef int PyArray_CHKFLAGS(ndarray arr, int flags)
1.17 - cdef int PyArray_HASFIELDS(ndarray arr, int flags)
1.18 + cdef int PyArray_HASFIELDS(ndarray arr)
1.19
1.20 cdef int PyDataType_HASFIELDS(dtype obj)
1.21
