Message399165
This class is not collected by the gc without a custom __del__ method to del or assign None to self.fn:
import gc
class Leak:
def __init__(self):
self.fn = self.x
def x(self):
pass
gc.set_debug(gc.DEBUG_SAVEALL)
l = Leak()
del l
gc.collect()
for item in gc.garbage:
print(item) |
|
Date |
User |
Action |
Args |
2021-08-07 02:20:59 | cliff.cordeiro | set | recipients:
+ cliff.cordeiro |
2021-08-07 02:20:59 | cliff.cordeiro | set | messageid: <1628302859.95.0.618033141977.issue44857@roundup.psfhosted.org> |
2021-08-07 02:20:59 | cliff.cordeiro | link | issue44857 messages |
2021-08-07 02:20:59 | cliff.cordeiro | create | |
|