diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-30 20:57:57 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-02 16:07:33 +0200 |
commit | ac8afca822031f3039dce31525a6ab48c741e73b (patch) | |
tree | 1f65aa3ac5ddd8234bd83125573691294f200707 /src/quick/items | |
parent | 1e454c8aa6ad0782eee1c8c94ac2780954a08351 (diff) |
Remove some more uses of QV4::Value
All remaining uses should be GC safe now.
Change-Id: I05c962de6ab896f108f70caa1bf937a24e67bfe1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/context2d/qquickcontext2d.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index 02a813e17f..bab9a2ce17 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -906,7 +906,7 @@ struct QQuickJSContext2DImageData : public QV4::Object - QV4::Value pixelData; + QV4::SafeValue pixelData; }; DEFINE_MANAGED_VTABLE(QQuickJSContext2DImageData); @@ -2975,7 +2975,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_drawImage(QV4::SimpleCallC V4THROW_DOM(DOMEXCEPTION_TYPE_MISMATCH_ERR, "drawImage(), type mismatch"); } } else if (QQuickJSContext2DImageData *imageData = arg->as<QQuickJSContext2DImageData>()) { - QQuickJSContext2DPixelData *pix = imageData->pixelData.as<QQuickJSContext2DPixelData>(); + QV4::Scoped<QQuickJSContext2DPixelData> pix(scope, imageData->pixelData.as<QQuickJSContext2DPixelData>()); if (pix && !pix->image.isNull()) { pixmap.take(new QQuickCanvasPixmap(pix->image, r->context->canvas()->window())); } else { @@ -3240,7 +3240,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createImageData(QV4::Simpl if (ctx->callData->argc == 1) { QV4::ScopedValue arg0(scope, ctx->callData->args[0]); if (QQuickJSContext2DImageData *imgData = arg0->as<QQuickJSContext2DImageData>()) { - QQuickJSContext2DPixelData *pa = imgData->pixelData.as<QQuickJSContext2DPixelData>(); + QV4::Scoped<QQuickJSContext2DPixelData> pa(scope, imgData->pixelData.as<QQuickJSContext2DPixelData>()); if (pa) { qreal w = pa->image.width(); qreal h = pa->image.height(); @@ -3320,7 +3320,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_putImageData(QV4::SimpleCa if (!imageData) return ctx->callData->thisObject.asReturnedValue(); - QQuickJSContext2DPixelData *pixelArray = imageData->pixelData.as<QQuickJSContext2DPixelData>(); + QV4::Scoped<QQuickJSContext2DPixelData> pixelArray(scope, imageData->pixelData.as<QQuickJSContext2DPixelData>()); if (pixelArray) { w = pixelArray->image.width(); h = pixelArray->image.height(); |