[Pyrex] __del__ not called on some objects

John (J5) Palmieri johnp at redhat.com
Fri Aug 26 04:57:39 CEST 2005


I just found a bug during my attempts to debug some memory leaks in the
dbus bindings.  We use __del__ to unref some C objects when the wrapper
Pyrex object goes out of scope.  The problem was our Message object was
not calling __del__ and causing a huge memory leak.  On further
inspection I noticed that other Message objects were.  The difference
was the one calling __del__ were all subclasses of Message.  Subclassing
Message solved the problem though it seems dubious why this would be the
case.  It might have something to do with the fact that Message exports
cdef methods while the derived classes only export the __init__
constructor.

If you need any more information let me know.
     
-- 
John (J5) Palmieri <johnp at redhat.com>




More information about the Pyrex mailing list