aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4stringobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-18 16:36:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-22 01:06:20 +0200
commitdf5edd28bc4258b89d9d5ffdddf837f339a17aad (patch)
tree2a5939d5e3c49928aadf43337832d3ef5a58df08 /src/qml/jsruntime/qv4stringobject.cpp
parent700ba1bcb39e082049c96fafdfaccfe5d83cd77e (diff)
convert Managed::put() API to be GC safe
Change-Id: I09198ce372fa545372db389fac26828d21ad5731 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4stringobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4stringobject.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp
index 22e746311c..26f662d005 100644
--- a/src/qml/jsruntime/qv4stringobject.cpp
+++ b/src/qml/jsruntime/qv4stringobject.cpp
@@ -379,7 +379,7 @@ ReturnedValue StringPrototype::method_match(SimpleCallContext *context)
return exec->call(callData);
ScopedString lastIndex(scope, context->engine->newString(QStringLiteral("lastIndex")));
- rx->put(lastIndex.getPointer(), Value::fromInt32(0));
+ rx->put(lastIndex, ScopedValue(scope, Value::fromInt32(0)));
Scoped<ArrayObject> a(scope, context->engine->newArrayObject());
double previousLastIndex = 0;
@@ -396,7 +396,7 @@ ReturnedValue StringPrototype::method_match(SimpleCallContext *context)
double thisIndex = index->toInteger();
if (previousLastIndex == thisIndex) {
previousLastIndex = thisIndex + 1;
- rx->put(lastIndex.getPointer(), Value::fromDouble(previousLastIndex));
+ rx->put(lastIndex, ScopedValue(scope, Value::fromDouble(previousLastIndex)));
} else {
previousLastIndex = thisIndex;
}