<div dir="ltr"><div class="gmail_extra">Hi, David</div><div class="gmail_extra"><br></div><div class="gmail_extra">See my comments below</div><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="">With PyQt 4.9.3 I don't get the behaviour you describe for your<br></div>
5-disconnect.py example. If I uncomment the line<br>
<br>
QTimer.singleShot(1000, lineEdit.purePythonMethod)<br>
<br>
then I get this output:<br>
<br>
~~~~ C++ lineEdit object destroyed<br>
~~~~ Pure Python method called<br>
Traceback (most recent call last):<br>
File "5-disconnect.py", line 47, in purePythonMethod<br>
self.windowTitle() # generate exception<br>
RuntimeError: wrapped C/C++ object of %S has been deleted<br>
~~~~ Application exited<br>
~~~~ Python lineEdit object destroyed<br>
<br>
This isn't a crash as I understand it.<br></blockquote><div>For me the test also generates RuntimeErrors. But in real big application a bug sometimes causes exceptions, and sometimes crashes the application. I don't know why.</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
I'm not sure what that example is trying to show. You create a QLineEdit<br>
widget, immediately schedule it for deletion then connect a QTimer signal<br>
to a slot/method.<br>
<br>
Did you expect that the connection would fail, or instead that the connection<br>
would be broken when the deleteLater() call takes effect so that the QTimer<br>
signal is not delivered?<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
It would be helpful if the article said what you thought the expected<br>
behaviour should be.<br></blockquote><div><br></div><div>I expect behavior, described in the QObject:~QObject documentation: "<span style="color:rgb(54,53,52);font-family:'Open Sans',sans-serif;font-size:13px;line-height:20px">All signals to and from the object are automatically disconnected"</span></div>
<div>As you can see in the table, some slots are disconnected, but not all.<br></div><div><br></div><div>Btw, this article was written in January 2014. I used up to date Ubuntu 13.10 for my tests. Pure-C++ case worked fine. But now on PyQt 4.10.3-1ubuntu1 RuntimeError is generated even for clear().</div>
<div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Regards,<br>
<br>
David<br>
<div class=""><div class="h5">_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></div></div></blockquote></div><br></div></div>