As PyArray_DescrConverter return new references, I think there could
be many places were PyArray_Descr* objects get its reference count
incremented.

Here, I send a patch correcting this for array() and arange(), but not
sure if this is the more general solution.

BTW, please see my previous comments in previous mail on using
convertor functions (returning new refs) and the (very common) idiom
"if(!PyArg_PaseXXX(,,,) return NULL", as this seems to be used in
almost all places in numpy C sources and is a potential source of ref
leaks.

Regards,

-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594

Attachment: array-arange.patch
Description: Binary data

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

Reply via email to