[PyKDE] Crash with unnotified event

Giovanni Bajo rasky at develer.com
Wed Jan 17 15:52:55 GMT 2007


On 1/17/2007 2:07 PM, Phil Thompson wrote:

>> this script causes a segfault for me with latest SIP snapshot and PyQt
>> 3.17:
>>
>> ================================================
>> from qt import *
>> app = QApplication([])
>> k = QWidget(None)
>> qApp.postEvent(k, QCustomEvent(QEvent.User))
>> del app
>> ================================================
> 
> Is this a recent problem with current snapshots?

This specific testcase crashes also with older versions of SIP and PyQt 
(4.4 and 3.16).

I'm getting a serie of crashes, all related to QApplication destruction 
and event delivery, which never triggered before but now trigger with 
recent SIP snapshots. This is the first testcase reduction I made (they 
are pretty difficult to reduce!). I have probably at least another to 
report that I'm still reducing.

> Is there a real use case (you'd never actually code the above)? Otherwise just 
> remove the "del".

Yes, the real use case is an automatic testsuite. For each test, I need 
to create and destroy a new QApplication to start afresh. It kind of 
works in C++, but I have historically always had troubles with PyQt. A 
generic workaround for me right now is to put a qApp.processEvents() 
before app destruction, but I would prefer if the bugs were fixed (and I 
thought you preferred it too...).
-- 
Giovanni Bajo




More information about the PyQt mailing list