Ralph Walden wrote:
>I seem to be having a problem getting my pygtk subclass objects
>to get collected.
>
>I looks as if when you do this:
>
>class mywin(gtk.GtkWindow):
> def __init__(self):
> gtk.GtkWindow.__init__(self)
>
> self.connect("some-signal",self.handler)
>
> def handler(self,widget,*args):
> pass
>
>that you have a circular reference. When objects of this
>class go out of scope, they persist, because the connection
>of the signal handler holds a reference (self) to the object.
>
>What's a good way around this?
>
>Am I wrong about that?
>
It should get cleaned up when the window is closed. Closing a toplevel
window causes its destroy signal handler to fire. The destroy signal
tells the window to "break references" to other objects. Among other
things, this should disconnect all of its signal handlers. I wouldn't
be surprised if there are still some reference loops though.
James.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/