Re: pixbuf leakage

"Walter C. Pelissero" <[email protected]> Tue, 6 May 2008 13:39:36 +0200
Newsgroups gmane.lisp.clg.devel
Message-ID <[email protected]>
Espen S Johnsen writes:
 > But it suddenly occurred to me why this code is leaking memory. The
 > signal handler closures keep references to the loader object, which
 > prevents the ref count from reaching zero and thus freeing the
 > object.

That's right.  Connecting the handlers with the :object argument
mended the leak.

BTW, it appears there is a C function (g_signal_connect_object) that
takes care of removing the signal handlers when an object is
destroyed, but I don't see how this could help us, as the reference is
kept alive by Lisp itself, in the closure.

Being a problem generalised to any object, maybe it could deserve a
mention in the documentation.  Just to keep other people from hitting
the same thumb again and again.

Thank you.

-- 
walter pelissero
http://www.pelissero.de

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone