[pygtk] PyGObject leaking?
John Ehresman
jpe at wingware.com
Thu Apr 12 22:19:14 WST 2007
Tony Nelson wrote:
> I say again: Python will collect objects as soon as they become
> unreferenced. Immediately. It has /nothing/ to do with Garbage
> Collection. It is Reference Counting, and it is the standard way that
> Python has always reclaimed unused objects, even before there was Cyclic GC.
You're correct that CPython uses reference counting and disposes of
objects when the count goes to 0. However when a object is part of a
cycle, the count won't go to 0 until the cyclic gc runs. Every python
wrapper for a GObject derived instance is part of a cycle, so these
objects are not disposed of until the gc runs.
Cheers,
John
More information about the pygtk
mailing list