Thank you I understand your point. I was just wondering why it worked in previous versions and thought this might be a bug.

On 07/09/2012 06:20 PM, Phil Thompson wrote:
On Mon, 09 Jul 2012 17:28:31 +0200, Sebastian Elsner
<sebastianels...@freenet.de> wrote:
Hello,

I am updating some code to use PyQt-Py2.6-x86-gpl-4.9.4-1.exe. I have
previously used PyQt-Py2.6-x86-gpl-4.8.6-1.exe. With the code attached I
get a runtime error in 4.9.4 I did not get in the 4.8.6.

Please execute the attached py file and click the open button in the
window appearing. This opens a dialog. Close the dialog and click the
signal button. Here I am getting an error:

Traceback (most recent call last):
    File "pyqt_runtimeerror.py", line 50, in check
      print "test checked", self.isChecked()
    File "pyqt_runtimeerror.py", line 28, in isChecked
      return self.checkBox.isChecked()
RuntimeError: wrapped C/C++ object of %S has been deleted
The %S is obviously a (sip) bug, but it doesn't affect anything.

To get rid of the problem I can comment line 8 (self.dialog = parent).
Is this something I should fix in my app and was the 4.8.6 behaviour
unintened or is this a bug?
The current behaviour seems perfectly reasonable to me. The C++ dialog and
its contents are destroyed when the dialog is closed. The corresponding
Python objects are still alive because you have an explicit reference. If
you remove that explicit reference (by commenting out line 8) then the
Python objects get garbage collected. You don't get an exception in that
case because the connection was broken when the slot object was garbage
collected.

Phil


_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to