[pygtk] PyGObject leaking?

Mario Beauchamp starged at gmail.com
Tue Apr 10 09:26:42 WST 2007


Hi Gustavo,

On 4/9/07, Gustavo J. A. M. Carneiro <gjc at inescporto.pt> wrote:
>
>   See http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq08.004.htp

Yes, that indeed does the trick but it means I have to add
gc.collect() everywhere I instantiate one of my types? That's kinda
counterproductive...

>   You should not ever rely on Python objects being freed immediately as
> they go out of scope.

I really thought they would. So it's a Python flaw, IMO.

> it just so happens that reference counting ensures garbage
> collection is often right after a reference going out of scope, but not always.

Well in this case, it is wrong 100% of the time...

Thank you for your quick answer.

cheers
-- 
Mario B.


More information about the pygtk mailing list