Sorry in advance if this is a know issue ... Anyway, I have no idea
about how to fix it ;-( ...
I have the following function, which expects a (possibly empty) list:
def gettok(tokens):
try:
return tokens.pop(0)
except IndexError:
return None
However, when I call "gettok" in a loop passing a empty list, 2
references are leaked per iteration.
I've distilled the problem to this: when the call "tokens.pop(0)"
actually raises IndexError, then the temporary 1-tuple with item "0"
(zero) that Cython build in order to make the method call is never
DECREF'ed; then you leak two references (the 1-tuple plus the integer
"0").
--
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
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev