aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4string.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4string.cpp')
-rw-r--r--src/qml/jsruntime/qv4string.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp
index 2b2eda7c8c..d0f3a196b7 100644
--- a/src/qml/jsruntime/qv4string.cpp
+++ b/src/qml/jsruntime/qv4string.cpp
@@ -173,15 +173,17 @@ ReturnedValue String::getIndexed(Managed *m, uint index, bool *hasProperty)
void String::put(Managed *m, String *name, const Value &value)
{
+ Scope scope(m->engine());
String *that = static_cast<String *>(m);
- Object *o = that->engine()->newStringObject(Value::fromString(that));
+ Scoped<Object> o(scope, that->engine()->newStringObject(Value::fromString(that)));
o->put(name, value);
}
void String::putIndexed(Managed *m, uint index, const Value &value)
{
+ Scope scope(m->engine());
String *that = static_cast<String *>(m);
- Object *o = m->engine()->newStringObject(Value::fromString(that));
+ Scoped<Object> o(scope, that->engine()->newStringObject(Value::fromString(that)));
o->putIndexed(index, value);
}