mirror of
https://github.com/status-im/qzxing.git
synced 2025-02-19 06:16:51 +00:00
Fixed crash when loading invalid image. (#160)
* Fixed crash when loading invalid image. * Fixed crash when loading invalid image (part2).
This commit is contained in:
parent
29597353ec
commit
dac9480a65
@ -36,6 +36,7 @@ QImage ImageHandler::extractQImage(QObject *imageObj, int offsetX, int offsetY,
|
||||
QTime timer;
|
||||
timer.start();
|
||||
QSharedPointer<QQuickItemGrabResult> result = item->grabToImage();
|
||||
if (result) {
|
||||
pendingGrabbersLocker.lockForWrite();
|
||||
pendingGrabbers << result.data();
|
||||
pendingGrabbersLocker.unlock();
|
||||
@ -52,6 +53,7 @@ QImage ImageHandler::extractQImage(QObject *imageObj, int offsetX, int offsetY,
|
||||
QThread::yieldCurrentThread();
|
||||
}
|
||||
img = result->image();
|
||||
}
|
||||
#else // QT_VERSION >= 0x050000
|
||||
QGraphicsObject *item = qobject_cast<QGraphicsObject*>(imageObj);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user