From: Konrad H. <hi...@cn...> - 2002-01-25 19:25:35
|
Kragen Sitaker <kr...@po...> writes: > There is one thing in arrayfrombuffer.c I'm not sure about, and > I could use some help here. arrayobj is the return value from > PyArray_FromDimsAndData: > /* do I need to incref arrayobj?! fromstring does... */ > return (PyObject*)arrayobj; > } > > So, do I? Or not? It seems to work as it is. And it is correct, in my opinion. Your routine is the owner of the array (and no one else keeps a reference), so you just pass on ownership. Doing an INCREF here would mean that the array is never freed. (Keep in mind that the data area is never freed anyway!) Konrad. -- ------------------------------------------------------------------------------- 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 ------------------------------------------------------------------------------- |