Add an example of a generator->freevar->cell->generator reference-cycle that

doesn't get cleaned up and thus leaks.
This commit is contained in:
Thomas Wouters 2006-03-28 08:14:24 +00:00
parent 96c3f7f56b
commit a33b2bc873
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
# This leaks since the introduction of yield-expr and the use of generators
# as coroutines, trunk revision 39239. The cycle-GC doesn't seem to pick up
# the cycle, or decides it can't clean it up.
def leak():
def gen():
while True:
yield g
g = gen()