[issue3680] Cycles with some iterator are leaking.

Martin v. Löwis report at bugs.python.org
Sun Sep 7 18:16:03 CEST 2008


Martin v. Löwis <martin at v.loewis.de> added the comment:

> This is my first excursion into cyclic garbage collector
> implementations, so please review carefully.

If you don't implement a tp_clear function, you should leave
a comment why not. I think it's ok, since the underlying
containers will get cleared, thus breaking the cycle.

> Also, I am not sure about
> tp_traverse for the deque type. Must the block member also be considered
> or is the deque member sufficient?

It is fine as-is. The iterator doesn't own the reference to the block
objects, and traversing the deque will also traverse all contained
objects.

> Finally, do you consider this a show stopper?

Not me. As-is, this bug doesn't cause crashes, and can be worked-around
in applications (by explicitly breaking the cycle).

----------
nosy: +loewis
title: Cycles with some iterator are leaking. -> Cycles with some iterator are	leaking.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3680>
_______________________________________


More information about the Python-bugs-list mailing list