Ticket #2245: def.py

File def.py, 382 bytes (added by redbaron, 6 years ago)

Minimal test-case shows huge memory leaks

Line 
1from twisted.internet.cdefer import Deferred
2from twisted.python import failure
3
4def cb1(res):
5    raise ValueError
6    return res
7
8def eb1(res):
9    return res
10
11def eb2(res):
12    return None
13
14
15def main():
16    for w in xrange(100000):
17        d = Deferred()
18        d.addCallback(cb1).addErrback(eb1).addBoth(eb2)
19        d.callback("testData")
20
21if __name__=='__main__':
22    main()