diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-18 16:36:02 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 01:06:20 +0200 |
commit | df5edd28bc4258b89d9d5ffdddf837f339a17aad (patch) | |
tree | 2a5939d5e3c49928aadf43337832d3ef5a58df08 /tools | |
parent | 700ba1bcb39e082049c96fafdfaccfe5d83cd77e (diff) |
convert Managed::put() API to be GC safe
Change-Id: I09198ce372fa545372db389fac26828d21ad5731
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/v4/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/v4/main.cpp b/tools/v4/main.cpp index a49245fba9..ad91b88cda 100644 --- a/tools/v4/main.cpp +++ b/tools/v4/main.cpp @@ -193,11 +193,11 @@ int main(int argc, char *argv[]) QV4::ExecutionContext *ctx = vm.rootContext; QV4::Scope scope(ctx); - QV4::Object *globalObject = vm.globalObject; - QV4::Object *print = new (ctx->engine->memoryManager) builtins::Print(ctx); - globalObject->put(vm.newIdentifier(QStringLiteral("print")), QV4::Value::fromObject(print)); - QV4::Object *gc = new (ctx->engine->memoryManager) builtins::GC(ctx); - globalObject->put(vm.newIdentifier(QStringLiteral("gc")), QV4::Value::fromObject(gc)); + QV4::ScopedObject globalObject(scope, vm.globalObject); + QV4::ScopedObject print(scope, new (ctx->engine->memoryManager) builtins::Print(ctx)); + globalObject->put(QV4::ScopedString(scope, vm.newIdentifier(QStringLiteral("print"))), print); + QV4::ScopedObject gc(scope, new (ctx->engine->memoryManager) builtins::GC(ctx)); + globalObject->put(QV4::ScopedString(scope, vm.newIdentifier(QStringLiteral("gc"))), gc); foreach (const QString &fn, args) { QFile file(fn); |