[PyKDE] Memory leak: Cycles with QObject's doesn't get collected

Phil Thompson phil at riverbankcomputing.co.uk
Tue Apr 5 09:04:23 BST 2005


> On Sun, 3 Apr 2005 00:30:23 +0100
> Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
>
>> That's because SIP has never supported the cyclic garbage collector.
>> That is
>> now fixed and your test script shows no leak.
>>
>> I've also added %GCTraverseCode and %GCClearCode to allow classes that
>> include
>> references to Python objects to play nicely. The only example in PyQt is
>> QCustomEvent.
>>
>
> So, only QCustomEvent is supported? I mean, if I use QDialog instead of
> QObject
> in the previous test, then it will leak?. I'm correct?

No. QCustomEvent requires additional support because it includes an
additional PyObject reference that SIP doesn't know about. All "normal"
wrapped classes should be Ok.

Phil




More information about the PyQt mailing list