On Fri, Dec 24, 2010 at 5:28 AM, Hrvoje Niksic <[email protected]> wrote: > The problem you describe sounds like it might be related to this infamous > PyGTK bug: > > https://bugzilla.gnome.org/show_bug.cgi?id=546802 > > In our tests the problems show up when a Python object that participates in > a cycle is referenced only through a GTK widget. When GC takes place, > Python's cycle-breaker incorrectly concludes that the whole cycle is > unreachable and runs tp_clear on all objects. The objects are, of course, > still reachable through PyGTK, and unfortunately now quite broken. > > A number of workarounds are available: simply access the widget's __dict__, > which forces it to switch to a different reference-counting strategy. Or > store a reference to your object in a global variable or container.
To me, this is clearly a pygtk bug. It should not be creating cycles like this. Also, it can create cycles without your participation. If you use builder, it can find callbacks using introspection. I have some modules that use introspection and have a few "connect" calls as well. To have to do all the introspection yourself in your own modules is ridiculous. > _______________________________________________ > pygtk mailing list [email protected] > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ > -- Gerald Britton _______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
