Ravi wrote:
> Hi,
>   Consider the following code:
>
>    PyArrayObject *array = get_me_an_array_along_with_a_reference(); /* 1 */
>    PyArray_Dims *dims = get_me_some_dims(); /* 2 */
>    array = (PyArrayObject *)PyArray_Resize( array, dims, 1 ); /* 3 */
>
> Is the code above valid? 
No.

You need to do something like:

temp = PyArray_Resize(array,...)
Py_DECREF(array)
array = temp

-Travis

_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to