-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.8.3
-
None
When you call grabToImage() on a QQuickItem you get back a QSharedPointer<QQuickItemGrabResult>
The QQuickItemGrabResult contains a QImage where the documentation states this:
If the grab is not yet complete or if it failed, a null image is returned (image.isNull() will return true).
If you check for isNull and release the QSharedPointer if its no longer false then it can happen that this leads to a crash. There seems to be a race condition where an QEvent is about to be posted but the release of the QSharedPointer destroys the event source
I attached a minimal example that shows this effect. It doesn't crash always when the QSharedPointer is released at the wrong time. But it happens after some time.
When the timer in the example is set to 0 it crashes almost immediately.
It also seems to happen only if VSync is disabled