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

Phil Thompson phil at riverbankcomputing.co.uk
Sun Apr 3 00:30:23 BST 2005


On Wednesday 30 March 2005 5:03 pm, Nahuel Greco wrote:
> I think I have found another memory leak. When you create cycles with
> QObjects they aren't collected. This doesn't happen with pure python
> objects (as expected), but in that case I have found an strange behaviour
> when you set the gc.DEBUG_SAVEALL flag (that isn't PyQT related, but take
> that in account if you add gc debug flags). See the attached script and
> their logs.

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.

Thanks for all the testing you've been doing recently - it's been really 
useful.

Phil




More information about the PyQt mailing list