[PyKDE] Re: Auto-disconnection of signals broken?

Giovanni Bajo rasky at develer.com
Tue Mar 14 12:03:05 GMT 2006


Giovanni Bajo <rasky at develer.com> wrote:

> Phil, the testcase is indeed fixed, but not the original bug in my
> application. I will try reducing a new testcase for the problem, 

That was faster than expected:

==========================================
from qt import *

app = QApplication([])

o = QObject(None)

class W(QWidget):
    def update(self):
        QWidget.update(self)

w = W(None)

QObject.connect(o, PYSIGNAL("FOO"), w.update)
o.emit(PYSIGNAL("FOO"), ())

w.deleteLater()
o.emit(PYSIGNAL("FOO"), ())

app.sendPostedEvents(w, QEvent.DeferredDelete)
o.emit(PYSIGNAL("FOO"), ())
==========================================
Traceback (most recent call last):
  File "D:\pyqtbug10.py", line 22, in ?
    o.emit(PYSIGNAL("FOO"), ())
  File "D:\pyqtbug10.py", line 11, in update
    QWidget.update(self)
RuntimeError: underlying C/C++ object has been deleted


This is with:
PyQt snapshot-20060311, SIP snapshot-20060312

-- 
Giovanni Bajo




More information about the PyQt mailing list