[PyQt] sip: Member objects and GC

Jonathan Kleinehellefort jk at molb.org
Thu Mar 8 22:14:49 GMT 2012

On Thu, 08 Mar 2012 10:03:46 +0000, Phil Thompson <phil at riverbankcomputing.com> wrote:
> Even if there is a reference cycle the garbage collector should break it
> if it is being allowed to run. Any test should explicitly invoke it.

Not sure if this applies here, but I think the Python GC will not call
destructors on objects that are part of a reference cycle.  So maybe the
Python wrappers get collected but not the C++ objects.

> Can you provide such a test that demonstrates the problem?

You can already see it in the original test I put up on my webserver.
But I updated it to make it more explicit:


The C++ objects have destructors that should print stuff, but that never

Another thing: it would be nice if sipKeepReference() would appear in the

 -- Jonathan

More information about the PyQt mailing list