<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Great! Using this reactor with the latest PyQt snapshot, I don't get the crash anymore!<div><br></div><div>I not sure why but with this reactor, closing the last window doesn't close the application. Ctrl-Q works fine and is the only way I can quit a GUI app.</div><div><br></div><div>I made sure that quitLastWindowClosed is set. The Signal lastWindowClosed is not emitted either. Any idea?</div><div><br></div><div>On the mac, running the following code and closing the window doesn't quit the application:</div><div><br></div><div><div>from qt4reactor import install;</div><div>from PyQt4.QtCore import *</div><div>from PyQt4.QtGui import *</div><div><br></div><div>app = QApplication([])</div><div><br></div><div>install()</div><div><br></div><div>if __name__ == '__main__':</div><div><br></div><div> widget = QWidget()</div><div> widget.show()</div><div><br></div><div> from twisted.internet import reactor</div><div> reactor.run()</div><div><br></div></div><div><br><div><div>On Oct 9, 2009, at 9:05 PM, Glenn Tarbox, PhD wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">You may want to try this reactor:<br><br><a href="https://launchpad.net/qt4reactor">https://launchpad.net/qt4reactor</a><br><br>I've just seen some other traffic on this topic... I'll dig into it a bit more this weekend<br>
<br>-glenn<br><br><div class="gmail_quote">On Fri, Oct 9, 2009 at 3:40 PM, Christian Caron <span dir="ltr"><<a href="mailto:ccaron@fattoc.com">ccaron@fattoc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="word-wrap: break-word;">I used to have this crash rather infrequently but it got more frequent when I moved to PyQt 4.6 / Snow Leopard.<div><br></div><div>Configuration</div><div>---------------------</div><div>
Mac OSX 10.6.1</div><div>Qt 4.5.3</div><div>sip-4.9.1-snapshot-20091007</div><div>PyQt-mac-gpl-4.6.1-snapshot-20091007</div><div><br></div><div>Crash</div><div>-----------</div><div><br></div><div>My investigation so far shows that PyQtProxy::unislot deletes memory that was already deleted (in attempting to self destruct).</div>
<div><br></div><div><div><font face="'Courier New'">Exception Type: EXC_BAD_ACCESS (SIGSEGV)</font></div><div><font face="'Courier New'">Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000028</font></div>
<div><font face="'Courier New'">Crashed Thread: 0 Dispatch queue: com.apple.main-thread</font></div><div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'"><br></font></span></font></div>
<div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">Thread 0 Crashed: Dispatch queue: com.apple.main-thread</font></span></font></div><div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">0 QtCore.so </font></span></font><span style="white-space: pre;"><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">        </font></span></font></span><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">0x00000001030db619 PyQtProxy::unislot(void**) + 133</font></span></font></div>
<div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">1 QtCore.so </font></span></font><span style="white-space: pre;"><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">        </font></span></font></span><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">0x00000001030db6f5 PyQtProxy::qt_metacall(QMetaObject::Call, int, void**) + 119</font></span></font></div>
<div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">2 QtCore </font></span></font><span style="white-space: pre;"><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">        </font></span></font></span><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">0x00000001005c1183 QMetaObject::activate(QObject*, int, int, void**) + 675</font></span></font></div>
<div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">3 QtCore.so </font></span></font><span style="white-space: pre;"><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">        </font></span></font></span><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">0x000000010302ae97 sipQTimer::timerEvent(QTimerEvent*) + 77</font></span></font></div>
<div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">4 QtCore </font></span></font><span style="white-space: pre;"><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">        </font></span></font></span><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">0x00000001005bf19e QObject::event(QEvent*) + 446</font></span></font></div>
<div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">5 QtCore.so </font></span></font><span style="white-space: pre;"><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">        </font></span></font></span><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">0x000000010302ae2d sipQTimer::event(QEvent*) + 77</font></span></font></div>
<div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">6 QtGui </font></span></font><span style="white-space: pre;"><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">        </font></span></font></span><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">0x00000001019fd3ed QApplicationPrivate::notify_helper(QObject*, QEvent*) + 189</font></span></font></div>
<div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">7 QtGui </font></span></font><span style="white-space: pre;"><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">        </font></span></font></span><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">0x0000000101a0405e QApplication::notify(QObject*, QEvent*) + 238</font></span></font></div>
<div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">8 QtGui.so </font></span></font><span style="white-space: pre;"><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">        </font></span></font></span><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">0x000000010136e1d1 sipQApplication::notify(QObject*, QEvent*) + 95</font></span></font></div>
<div><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">9 QtCore </font></span></font><span style="white-space: pre;"><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">        </font></span></font></span><font size="4"><span style="font-size: 14px;"><font face="'Courier New'">0x00000001005aec3c QCoreApplication::notifyInternal(QObject*, QEvent*) + 124</font></span></font></div>
<div><font face="'Courier New'"><br></font></div><div><font face="'Courier New'"><span style="font-family: Helvetica;"><div>Repro</div><div>-----------</div><div>Using the qt4reactor found here: <a href="http://twistedmatrix.com/trac/browser/sandbox/therve/qt4reactor.py?rev=22736&format=txt" target="_blank">http://twistedmatrix.com/trac/browser/sandbox/therve/qt4reactor.py?rev=22736&format=txt</a></div>
<div>You may need to run the program a few times for it to crash.</div><div><br></div><div><div><font size="4" face="'Courier New'"><span style="font-size: 14px;">import qt4reactor</span></font></div><div><font size="4" face="'Courier New'"><span style="font-size: 14px;">qt4reactor.install()</span></font></div>
<div><font size="4" face="'Courier New'"><span style="font-size: 14px;"><br></span></font></div><div><font size="4" face="'Courier New'"><span style="font-size: 14px;"># Control-C</span></font></div><div><font size="4" face="'Courier New'"><span style="font-size: 14px;">from twisted.internet import reactor</span></font></div>
<div><font size="4" face="'Courier New'"><span style="font-size: 14px;">import signal; signal.signal(signal.SIGINT, lambda *args:reactor.stop())</span></font></div><div><font size="4" face="'Courier New'"><span style="font-size: 14px;"><br>
</span></font></div><div><font size="4" face="'Courier New'"><span style="font-size: 14px;"># Get web page.</span></font></div><div><font size="4" face="'Courier New'"><span style="font-size: 14px;">from twisted.web import client</span></font></div>
<div><font size="4" face="'Courier New'"><span style="font-size: 14px;">url = '<a href="http://www.google.com/" target="_blank">http://www.google.com</a>'</span></font></div><div><font size="4" face="'Courier New'"><span style="font-size: 14px;">client.getPage(url)</span></font></div>
<div><font size="4" face="'Courier New'"><span style="font-size: 14px;"><br></span></font></div><div><font size="4" face="'Courier New'"><span style="font-size: 14px;">reactor.run()</span></font></div></div>
</span></font></div></div></div><br>_______________________________________________<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><br></blockquote></div><br><br clear="all"><br>-- <br>Glenn H. Tarbox, PhD || 206-274-6919 || <a href="mailto:glenn@tarbox.org">glenn@tarbox.org</a> - xmpp || ghtdak - aim,jabber,IRC,yahoo<br>
<br>
</blockquote></div><br></div></body></html>