Fix a crash of accessing deleted paintengine
When painting to QPixmap with QBlitterPaintEngine and dfb PaintEngine have PaintDevice (pdev) as QImage. Painter code uses PaintDevice::paintEngine() to refer to paintEngine. This will became dangling pointer since QDirectFbBlitter::doLock() will delete QImage. Instead return QPixmap as PaintDevice. Change-Id: Idfac919b6438a82b412020e441e0a102e4a2a052 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
This commit is contained in:
parent
45f264b682
commit
72fe9f1d0d
@ -494,11 +494,12 @@ void QBlitterPaintEngine::clipEnabledChanged()
|
|||||||
|
|
||||||
bool QBlitterPaintEngine::begin(QPaintDevice *pdev)
|
bool QBlitterPaintEngine::begin(QPaintDevice *pdev)
|
||||||
{
|
{
|
||||||
|
Q_D(QBlitterPaintEngine);
|
||||||
bool ok = QRasterPaintEngine::begin(pdev);
|
bool ok = QRasterPaintEngine::begin(pdev);
|
||||||
#ifdef QT_BLITTER_RASTEROVERLAY
|
#ifdef QT_BLITTER_RASTEROVERLAY
|
||||||
Q_D(QBlitterPaintEngine);
|
|
||||||
d->pmData->unmergeOverlay();
|
d->pmData->unmergeOverlay();
|
||||||
#endif
|
#endif
|
||||||
|
d->pdev = pdev;
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user