[PyQt] PyQt & Twisted
Christian Caron
ccaron at fattoc.com
Mon Oct 12 01:09:28 BST 2009
Great! Using this reactor with the latest PyQt snapshot, I don't get
the crash anymore!
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.
I made sure that quitLastWindowClosed is set. The Signal
lastWindowClosed is not emitted either. Any idea?
On the mac, running the following code and closing the window doesn't
quit the application:
from qt4reactor import install;
from PyQt4.QtCore import *
from PyQt4.QtGui import *
app = QApplication([])
install()
if __name__ == '__main__':
widget = QWidget()
widget.show()
from twisted.internet import reactor
reactor.run()
On Oct 9, 2009, at 9:05 PM, Glenn Tarbox, PhD wrote:
> You may want to try this reactor:
>
> https://launchpad.net/qt4reactor
>
> I've just seen some other traffic on this topic... I'll dig into it
> a bit more this weekend
>
> -glenn
>
> On Fri, Oct 9, 2009 at 3:40 PM, Christian Caron <ccaron at fattoc.com>
> wrote:
> I used to have this crash rather infrequently but it got more
> frequent when I moved to PyQt 4.6 / Snow Leopard.
>
> Configuration
> ---------------------
> Mac OSX 10.6.1
> Qt 4.5.3
> sip-4.9.1-snapshot-20091007
> PyQt-mac-gpl-4.6.1-snapshot-20091007
>
> Crash
> -----------
>
> My investigation so far shows that PyQtProxy::unislot deletes memory
> that was already deleted (in attempting to self destruct).
>
> Exception Type: EXC_BAD_ACCESS (SIGSEGV)
> Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000028
> Crashed Thread: 0 Dispatch queue: com.apple.main-thread
>
> Thread 0 Crashed: Dispatch queue: com.apple.main-thread
> 0 QtCore.so 0x00000001030db619
> PyQtProxy::unislot(void**) + 133
> 1 QtCore.so 0x00000001030db6f5
> PyQtProxy::qt_metacall(QMetaObject::Call, int, void**) + 119
> 2 QtCore 0x00000001005c1183
> QMetaObject::activate(QObject*, int, int, void**) + 675
> 3 QtCore.so 0x000000010302ae97
> sipQTimer::timerEvent(QTimerEvent*) + 77
> 4 QtCore 0x00000001005bf19e QObject::event
> (QEvent*) + 446
> 5 QtCore.so 0x000000010302ae2d
> sipQTimer::event(QEvent*) + 77
> 6 QtGui 0x00000001019fd3ed
> QApplicationPrivate::notify_helper(QObject*, QEvent*) + 189
> 7 QtGui 0x0000000101a0405e
> QApplication::notify(QObject*, QEvent*) + 238
> 8 QtGui.so 0x000000010136e1d1
> sipQApplication::notify(QObject*, QEvent*) + 95
> 9 QtCore 0x00000001005aec3c
> QCoreApplication::notifyInternal(QObject*, QEvent*) + 124
>
> Repro
> -----------
> Using the qt4reactor found here: http://twistedmatrix.com/trac/browser/sandbox/therve/qt4reactor.py?rev=22736&format=txt
> You may need to run the program a few times for it to crash.
>
> import qt4reactor
> qt4reactor.install()
>
> # Control-C
> from twisted.internet import reactor
> import signal; signal.signal(signal.SIGINT, lambda *args:reactor.stop
> ())
>
> # Get web page.
> from twisted.web import client
> url = 'http://www.google.com'
> client.getPage(url)
>
> reactor.run()
>
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>
>
> --
> Glenn H. Tarbox, PhD || 206-274-6919 || glenn at tarbox.org - xmpp ||
> ghtdak - aim,jabber,IRC,yahoo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20091012/13f2890d/attachment-0001.html
More information about the PyQt
mailing list