[Python-Dev] We got leaks!

Tim Peters tim.one@comcast.net
Fri, 06 Dec 2002 18:32:18 -0500


> First minimal test case:
>
>   class Leaker(object):
>     def __hash__(self): return 1
>
>   for i in range(10):
>       hash( Leaker() )
>       print '*' * 10, 'total refs:', sys.gettotalrefcount()

This one is clearly a missing decref in slot_tp_hash(), leaking a reference
to the integer result object.  If SourceForge wakes up, I've got a fix ready
to check in.