[PyQt] Segfault in PyQt 4.6.1

Giovanni Bajo rasky at develer.com
Thu Oct 29 20:39:34 GMT 2009


On Thu, 29 Oct 2009 18:49:27 +0000, Phil Thompson
<phil at riverbankcomputing.com> wrote:
> On Thu, 29 Oct 2009 11:47:44 -0600, Kovid Goyal <kovid at kovidgoyal.net>
> wrote:
>> I should add that the segfault is present in the current snapshot as
> well:
>> 
>> python2.6 -c "from PyQt4.Qt import QApplication, PYQT_VERSION_STR;
>> QApplication([]); print PYQT_VERSION_STR; from PyQt4.QtWebKit import
>> QWebPage; QWebPage()"
>> 
>> 4.7-snapshot-20091028
>> Segmentation fault
> 
> The QApplication instance is being garbage collected before the QWebPage
is
> created.
> 
> It worked in earlier versions because of a PyQt bug which meant that the
> QApplication dtor was never called - but it is now.

Thought it is debatable that QApplication's instances are not owned by C++
by default. Giving ownership to Python doesn't seem to give much of an
advantage (you probably are better off using sip.delete() anyway when you
really really want to destroy an application).
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com


More information about the PyQt mailing list