diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-16 22:02:27 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 01:06:20 +0200 |
commit | e441692b0b8f8fffdfdfa8a21c570adcd5cbae7a (patch) | |
tree | 9b764401d87682012328c46dc947721f47b428b2 /src/qml/jsruntime/qv4include.cpp | |
parent | a0f8be4021caa9bb5055923f0eea3bee0e345235 (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/qml/jsruntime/qv4include.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4include.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp index 740bb406f3..4d9573b990 100644 --- a/src/qml/jsruntime/qv4include.cpp +++ b/src/qml/jsruntime/qv4include.cpp @@ -84,9 +84,10 @@ QV4Include::~QV4Include() QV4::ReturnedValue QV4Include::resultValue(QV4::ExecutionEngine *v4, Status status) { + QV4::Scope scope(v4); // XXX It seems inefficient to create this object from scratch each time. - QV4::Object *o = v4->newObject(); + QV4::Scoped<QV4::Object> o(scope, v4->newObject()); o->put(v4->newString("OK"), QV4::Value::fromInt32(Ok)); o->put(v4->newString("LOADING"), QV4::Value::fromInt32(Loading)); o->put(v4->newString("NETWORK_ERROR"), QV4::Value::fromInt32(NetworkError)); @@ -94,7 +95,7 @@ QV4::ReturnedValue QV4Include::resultValue(QV4::ExecutionEngine *v4, Status stat o->put(v4->newString("status"), QV4::Value::fromInt32(status)); - return QV4::Value::fromObject(o).asReturnedValue(); + return o.asReturnedValue(); } void QV4Include::callback(const QV4::Value &callback, const QV4::Value &status) |