aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4qobjectwrapper.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-10-10 16:17:28 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-11 08:56:26 +0200
commit40db24351b6a89a3fb30a4870afdf90a4b91663f (patch)
tree2fa70623d615cef347c4ad3f9e8422455abc4aa3 /src/qml/jsruntime/qv4qobjectwrapper.cpp
parentb0e83cdc1a3a80ecc26cb31ac046b6c743238d41 (diff)
Smaller cleanups
Change-Id: I0a7eee96ef7c92ad4a3c5963010e3ac66fe6ed3a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 6e474ecc5d..d42d842ab7 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -1486,7 +1486,11 @@ void CallArgument::initAsType(int callType)
void CallArgument::fromValue(int callType, QV8Engine *engine, const QV4::ValueRef value)
{
- if (type != 0) { cleanup(); type = 0; }
+ if (type != 0) {
+ cleanup();
+ type = 0;
+ }
+
QV4::Scope scope(QV8Engine::getV4(engine));
if (callType == qMetaTypeId<QJSValue>()) {
@@ -1524,7 +1528,8 @@ void CallArgument::fromValue(int callType, QV8Engine *engine, const QV4::ValueRe
type = callType;
} else if (callType == qMetaTypeId<QList<QObject*> >()) {
qlistPtr = new (&allocData) QList<QObject *>();
- if (QV4::ArrayObject *array = value->asArrayObject()) {
+ QV4::ScopedArrayObject array(scope, value);
+ if (array) {
Scoped<QV4::QObjectWrapper> qobjectWrapper(scope);
uint32_t length = array->arrayLength();