[PyQt] Freezes and crashes with signal autoconnection

Christian Roche christian.roche.fr at gmail.com
Sun Oct 11 22:36:37 BST 2009

Phil Thompson-5 wrote:
> Can you try with the latest installer (though it does contain a nasty
> thread-related regression).
> Do you have a test case?
> Phil

Hi Phil,

I'm currently using PyQt 4.6-1 with Python 2.6.3. I think I've been able to
isolate a  http://www.nabble.com/file/p25847873/main.py test case  that
crashes consistently and demonstrates at least one of the problems I've been
experiencing with PyQt multithreading.

In this piece of code, when the time delay in the GalleryCreator thread is
greater than the delay in the GalleryModel appendLink slot, the application
works fine. However if this delay is set to a value less than the latter,
then it crashes after a few iterations. It seems that the QAbstractListModel
object doesn't like it when a queue of pending events is forming, with
custom data types.

Also in the second case, the application won't crash if you use
Qt.BlockingQueuedConnection instead of AutoConnection (see line 111). This
makes sense since in that case no event queue is forming, the Model object
has enough time to consume the incoming event before a new one is posted.

The application won't crash either if you use 'PyQt_PyObject' instead of
ImageLink in the signal argument (see line 88). Don't ask me why :-)

Note: I see a similar behaviour on Linux.


View this message in context: http://www.nabble.com/Freezes-and-crashes-with-signal-autoconnection-tp25716493p25847873.html
Sent from the PyQt mailing list archive at Nabble.com.

More information about the PyQt mailing list