From: Konrad H. <hi...@cn...> - 2003-12-01 10:10:39
|
On Monday 01 December 2003 07:15, Michiel Jan Laurens de Hoon wrote: > In Chapter 12 ("Writing a C extension") in the Numerical Python manual,= in > the first example PyArray_ContiguousFromObject is used together with > PyDECREF, while in the last example PyArray_ContiguousFromObject is use= d > but the arrays are not PyDECREF'ed before the function returns. From > Chapter 13 ("C API Reference") it seems that a PyDECREF is needed in bo= th > cases. Or am I missing something here? Is PyDECREF not needed for some > reason in the last example? It should be there, the second example as presented has a memory leak. Konrad. --=20 -------------------------------------------------------------------------= ------ Konrad Hinsen | E-Mail: hi...@cn... Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais -------------------------------------------------------------------------= ------ |