From f79df5da0769836bc866b470cdac43d6363dc7db Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 14 Sep 2013 11:25:02 +0200 Subject: Convert more methods to return a Returned<> Change-Id: If294c9c4f574824c308b63a11da1337226180105 Reviewed-by: Simon Hausmann --- src/particles/qquickcustomaffector.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/particles/qquickcustomaffector.cpp') diff --git a/src/particles/qquickcustomaffector.cpp b/src/particles/qquickcustomaffector.cpp index 40d0df1a22..09f8967045 100644 --- a/src/particles/qquickcustomaffector.cpp +++ b/src/particles/qquickcustomaffector.cpp @@ -146,13 +146,14 @@ void QQuickCustomAffector::affectSystem(qreal dt) QQmlEngine *qmlEngine = ::qmlEngine(this); QV4::ExecutionEngine *v4 = QV8Engine::getV4(qmlEngine->handle()); - QV4::ArrayObject *array = v4->newArrayObject(toAffect.size()); + QV4::Scope scope(v4); + QV4::Scoped array(scope, v4->newArrayObject(toAffect.size())); for (int i=0; iputIndexed(i, toAffect[i]->v4Value().toValue()); if (dt >= simulationCutoff || dt <= simulationDelta) { affectProperties(toAffect, dt); - emit affectParticles(QQmlV4Handle(QV4::Value::fromObject(array)), dt); + emit affectParticles(QQmlV4Handle(array.asValue()), dt); } else { int realTime = m_system->timeInt; m_system->timeInt -= dt * 1000.0; @@ -160,12 +161,12 @@ void QQuickCustomAffector::affectSystem(qreal dt) m_system->timeInt += simulationDelta * 1000.0; dt -= simulationDelta; affectProperties(toAffect, simulationDelta); - emit affectParticles(QQmlV4Handle(QV4::Value::fromObject(array)), simulationDelta); + emit affectParticles(QQmlV4Handle(array.asValue()), simulationDelta); } m_system->timeInt = realTime; if (dt > 0.0) { affectProperties(toAffect, dt); - emit affectParticles(QQmlV4Handle(QV4::Value::fromObject(array)), dt); + emit affectParticles(QQmlV4Handle(array.asValue()), dt); } } -- cgit v1.2.3