diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-11 21:48:23 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:13:36 +0200 |
commit | 6c9f1c8ed93374c16ca6ac540f39e98b451be0d8 (patch) | |
tree | 476d0046c6016a8cd62bfc29ed9697d98e98f738 /src/quick/util/qquickglobal.cpp | |
parent | bdb27b96acbd38531879378c48959a5a1cd60963 (diff) |
Use a ReturnedValue for Managed::getIndexed()
Change-Id: I0371ed21c4ef99564d3ffa1082dd109e890a78bf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick/util/qquickglobal.cpp')
-rw-r--r-- | src/quick/util/qquickglobal.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index 1af04505b3..c08719dec8 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -394,15 +394,18 @@ public: if (!array) return QMatrix4x4(); + QV4::Scope scope(array->engine()); + if (array->arrayLength() != 16) return QMatrix4x4(); float matVals[16]; + QV4::ScopedValue v(scope); for (quint32 i = 0; i < 16; ++i) { - QV4::Value v = array->getIndexed(i); - if (!v.isNumber()) + v = array->getIndexed(i); + if (!v->isNumber()) return QMatrix4x4(); - matVals[i] = v.asDouble(); + matVals[i] = v->asDouble(); } if (ok) *ok = true; |