[PyKDE] Regression caused by lambda as slots

Phil Thompson phil at riverbankcomputing.co.uk
Sun Jan 21 16:43:13 GMT 2007

On Wednesday 17 January 2007 11:33 pm, Giovanni Bajo wrote:
> On 17/01/2007 18.09, Giovanni Bajo wrote:
> > I think I have managed to produce a (convoluted) testcase for what
> > appears to be a reference leak introduced by recent SIP versions. It
> > ought to be when you added support for lambda expressions as slots.
> I think I know the problem: sipWrapper_traverse() does not know anything
> about lambda expressions in slots. Thus, the GC can't fully traverse the
> lambda expressions (whose reference is being kept by the sender object),
> and can't do a full collection of all unreachable items.
> I could attempt a fix but I'm not sure how you want to deal with it, since
> the signal/slot part is pretty internal of qtlib.c, while
> sipWrapper_traverse() is in siplib.c. Also, I don't fully understand all
> the semantics of sipSlot (all the combinations of possible NULLs/values for
> its members) so I'd rather leave this to you.

Should be fixed in tonight's SIP and PyQt3/4 snapshots.

I suspect that these fixes represent most of the work needed to allow SIP to 
take a reference to non-lambda slots as well. Can you come up with a similar 
test case for that scenario?


More information about the PyQt mailing list