diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-23 15:52:10 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-26 09:05:16 +0200 |
commit | 12fd2ccd3fa2dc0133b5a3fb89f9fdf5cf721232 (patch) | |
tree | 880acb9c7c0d8289185b6aebe4339f439c707a0e /src/quick/items/context2d/qquickcanvasitem.cpp | |
parent | 2e4f66caa8a5f9e887dbdb4e3f2ae5c9be9a7005 (diff) |
Fix Persistent/WeakValue API
Don't use unprotected Values in the API anymore.
Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick/items/context2d/qquickcanvasitem.cpp')
-rw-r--r-- | src/quick/items/context2d/qquickcanvasitem.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index f21abdab67..78369eb404 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -666,7 +666,7 @@ void QQuickCanvasItem::updatePolish() callData->thisObject = QV4::Value::fromReturnedValue(QV4::QObjectWrapper::wrap(v4, this)); foreach (int key, animationCallbacks.keys()) { - QV4::FunctionObject *f = animationCallbacks.value(key).value().asFunctionObject(); + QV4::ScopedFunctionObject f(scope, animationCallbacks.value(key).value()); callData->args[0] = QV4::Value::fromUInt32(QDateTime::currentDateTimeUtc().toTime_t()); f->call(callData); } @@ -789,7 +789,9 @@ void QQuickCanvasItem::requestAnimationFrame(QQmlV4Function *args) static int id = 0; - d->animationCallbacks.insert(++id, QV4::PersistentValue((*args)[0])); + QV4::Scope scope(QV8Engine::getV4(args->engine())); + QV4::ScopedValue v(scope, (*args)[0]); + d->animationCallbacks.insert(++id, QV4::PersistentValue(v)); if (isVisible()) polish(); |