Nigel Tao wrote:
When using the Python bindings to GTK or GLib, I have so far not bothered to think about reference counting. Is it the case that Python memory management / garbage collection and PyGTK work nicely in all cases so that I never have to think about it?
Yes. PyGTK works very well with GTK with regards to reference counting.
In particular, I was looking at some C code using gnome-vfs the other day, and it seemed to make a lot of fuss about un-reffing things. Is VFS a special case - would I have to be similarly fussy if I wanted to use the python gnome.vfs module?
I've not used gnome.vfs, nor looked at the code, but from my PyGTK knowlegde I'm certain you do not have to bother with it. The Python wrapper objects hold a reference to the gnome.vfs/GObjects. When the Python objects are destroyed by the garbage collector, the GObject's are unref'ed automatocally.
Please correct me if I'm wrong.
Regards,
Arjan
thanks, Nigel.
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
