aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/xmllistmodel
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-16 22:02:27 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-22 01:06:20 +0200
commite441692b0b8f8fffdfdfa8a21c570adcd5cbae7a (patch)
tree9b764401d87682012328c46dc947721f47b428b2 /src/imports/xmllistmodel
parenta0f8be4021caa9bb5055923f0eea3bee0e345235 (diff)
Further work towards an exact GC
Add some more convenience in the helper classes in qscopedvalue_p.h Make accesses to CallData safer, and change ExecutionEngine::newObject() to return a safe pointer. Change-Id: I980909754ce9681cf6faa1355bab3a1e5d6dd186 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/imports/xmllistmodel')
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
index 9f6437625d..f87273be40 100644
--- a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
@@ -923,13 +923,14 @@ QQmlV4Handle QQuickXmlListModel::get(int index) const
QQmlEngine *engine = qmlContext(this)->engine();
QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(engine);
ExecutionEngine *v4engine = QV8Engine::getV4(v8engine);
- Object *o = v4engine->newObject();
+ Scope scope(v4engine);
+ Scoped<Object> o(scope, v4engine->newObject());
for (int ii = 0; ii < d->roleObjects.count(); ++ii) {
Property *p = o->insertMember(v4engine->newIdentifier(d->roleObjects[ii]->name()), PropertyAttributes());
p->value = Value::fromReturnedValue(v8engine->fromVariant(d->data.value(ii).value(index)));
}
- return QQmlV4Handle(Value::fromObject(o));
+ return QQmlV4Handle(o.asValue());
}
/*!