aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-11 14:36:01 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-18 13:13:21 +0200
commit002e6105f61269f1474de878ccdb26205e5b226e (patch)
treeead1d10b7d8aa2537e7073327d9d0d9ce591c995 /src/quick/items/context2d
parent1a2a83f80ba4ecc28eba72af57c81bd43a45946c (diff)
Require a ValueScope for ScopedCallData as well
This brings things more in line with ScopedValue, and also simplifies cleanup of Scoped values. Change-Id: If5f1466b4e13c629d56c1e7c638937f61ba48f77 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick/items/context2d')
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index 60cb3ace3e..f38328da6d 100644
--- a/src/quick/items/context2d/qquickcanvasitem.cpp
+++ b/src/quick/items/context2d/qquickcanvasitem.cpp
@@ -660,12 +660,13 @@ void QQuickCanvasItem::updatePolish()
QMap<int, QV4::PersistentValue> animationCallbacks = d->animationCallbacks;
d->animationCallbacks.clear();
+ QV4::ExecutionEngine *v4 = QQmlEnginePrivate::getV4Engine(qmlEngine(this));
+ QV4::ValueScope scope(v4);
+ QV4::ScopedCallData callData(scope, 1);
+ callData->thisObject = QV4::QObjectWrapper::wrap(v4, this);
+
foreach (int key, animationCallbacks.keys()) {
- QV4::ExecutionEngine *v4 = QQmlEnginePrivate::getV4Engine(qmlEngine(this));
QV4::FunctionObject *f = animationCallbacks.value(key).value().asFunctionObject();
-
- QV4::ScopedCallData callData(v4, 1);
- callData->thisObject = QV4::QObjectWrapper::wrap(v4, this);
callData->args[0] = QV4::Value::fromUInt32(QDateTime::currentDateTimeUtc().toTime_t());
f->call(callData);
}