aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4stringobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-10-11 12:26:27 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-11 16:01:24 +0200
commite964fc34269bc2087fb3246172a1890224a160bd (patch)
treeb66e36e3fa6280bc94ad00002c035280ff24deee /src/qml/jsruntime/qv4stringobject.cpp
parentf6de6160b915b5a35e75746a35c4ef94ceb9b2c2 (diff)
Fix the remaining objects against self destruction
This makes pretty much all test cases pass with exact garbage collection. Change-Id: Ia874e3c17c3984afb7cfe370f9bd3ad8fe46699a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4stringobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4stringobject.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp
index 7e503e4b1a..25e1ea55c2 100644
--- a/src/qml/jsruntime/qv4stringobject.cpp
+++ b/src/qml/jsruntime/qv4stringobject.cpp
@@ -82,6 +82,10 @@ StringObject::StringObject(InternalClass *ic)
{
vtbl = &static_vtbl;
type = Type_StringObject;
+
+ Scope scope(engine());
+ ScopedObject protectThis(scope, this);
+
value = ic->engine->newString("")->asReturnedValue();
tmpProperty.value = Primitive::undefinedValue();
@@ -94,6 +98,10 @@ StringObject::StringObject(ExecutionEngine *engine, const ValueRef val)
{
vtbl = &static_vtbl;
type = Type_StringObject;
+
+ Scope scope(engine);
+ ScopedObject protectThis(scope, this);
+
value = *val;
tmpProperty.value = Primitive::undefinedValue();