[Python-bugs-list] Assigning function objects to instance variable causes memory leak (PR#346)
jparkey@rapidbs.com
jparkey@rapidbs.com
Mon, 5 Jun 2000 12:06:36 -0400 (EDT)
Full_Name: John Parkey
Version: 1.5.2
OS: NT (build 132)
Submission from: mail.rapidbs.com (195.92.50.66)
Assigning a function object to an instance variable leaks memory. Run the
programme below with the Windows task manager up to see the effect.
class fred:
def __init__(self):
self.indirectFunc = self.theFunc
def theFunc(self):
return "blah"
def test():
f = fred()
del f
if __name__ == "__main__":
for x in xrange(1000):
test()