[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] pysignals and Py_DECREF
From: "Patrick Stinson" <patrickkidd.lists () gmail ! com>
Date: 2006-05-25 20:42:24
Message-ID: 664bf2b80605251342i5a15dc95q19722a6734fd4aa9 () mail ! gmail ! com
[Download RAW message or body]
On 5/25/06, Phil Thompson <phil@riverbankcomputing.co.uk> wrote:
> On Monday 22 May 2006 3:38 am, Patrick Stinson wrote:
> > I am trying to disconnect all of the signals that I connected to a
> > QObject in order to ensure that it is deleted. The following program
> > prints "Object::disconnect: No such signal QObject::bleh(QObject*)" if
> > I uncomment the disconnect line, but also deletes the object when it
> > is dereferenced.
>
> The error message is due a SIP bug - fixed in tonight's snapshot.
>
> > from PyQt4.QtCore import *
> >
> > class O(QObject):
> > def __init__(self):
> > QObject.__init__(self)
> > def __del__(self):
> > print '__del__'
> >
> > def slot(o):
> > print o
> >
> > o = O()
> > QObject.connect(o, SIGNAL('bleh(QObject *)'), slot)
> > #QObject.disconnect(o, SIGNAL('bleh(QObject *)'), slot)
> > o = None
> > print 'here'
> >
> >
> > I am posting this because I realized that I have no idea how
> > python-defined signals act anymore. I thought that if I connected the
> > signal the reference count was incremented, and I had to disconect it
> > if I wanted to delete the QObject. is this still true?
>
> It has never been true precisely to avoid having to manually disconnect
> everything.
isn't that a relief...
>
> > Any other
> > relavent commentary regarding references, pysignals, and
> > QObject::disconnect?
>
> Phil
>
--
Patrick Kidd Stinson
http://www.patrickkidd.com/
http://pkaudio.sourceforge.net/
http://pksampler.sourceforge.net/
_______________________________________________
PyKDE mailing list PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic