aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4objectiterator.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2014-12-15 08:46:38 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-20 12:00:39 +0100
commit74c658bb631fd5bab433b9867ff2e568a56ec082 (patch)
treecf82000446c51064a2f8643fd5ffd74b0bcca668 /src/qml/jsruntime/qv4objectiterator.cpp
parent965fac4418bec7e7b3c84efd76f7803116fb9eac (diff)
Make Property uses GC safe
Change-Id: I5aa41a07a2d25e5c8a2d64bfa58a55fcd7aaf77e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4objectiterator.cpp')
-rw-r--r--src/qml/jsruntime/qv4objectiterator.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp
index 5c8df40c4c..a5a15711f7 100644
--- a/src/qml/jsruntime/qv4objectiterator.cpp
+++ b/src/qml/jsruntime/qv4objectiterator.cpp
@@ -135,15 +135,15 @@ ReturnedValue ObjectIterator::nextPropertyName(ValueRef value)
return Encode::null();
PropertyAttributes attrs;
- Property p;
uint index;
Scope scope(object->engine());
+ ScopedProperty p(scope);
ScopedString name(scope);
- next(name.getRef(), &index, &p, &attrs);
+ next(name.getRef(), &index, p, &attrs);
if (attrs.isEmpty())
return Encode::null();
- value = object->objectValue()->getValue(&p, attrs);
+ value = object->objectValue()->getValue(p, attrs);
if (!!name)
return name->asReturnedValue();
@@ -157,15 +157,15 @@ ReturnedValue ObjectIterator::nextPropertyNameAsString(ValueRef value)
return Encode::null();
PropertyAttributes attrs;
- Property p;
uint index;
Scope scope(object->engine());
+ ScopedProperty p(scope);
ScopedString name(scope);
- next(name.getRef(), &index, &p, &attrs);
+ next(name.getRef(), &index, p, &attrs);
if (attrs.isEmpty())
return Encode::null();
- value = object->objectValue()->getValue(&p, attrs);
+ value = object->objectValue()->getValue(p, attrs);
if (!!name)
return name->asReturnedValue();
@@ -179,12 +179,11 @@ ReturnedValue ObjectIterator::nextPropertyNameAsString()
return Encode::null();
PropertyAttributes attrs;
- // ### GC
- Property p;
uint index;
Scope scope(object->engine());
+ ScopedProperty p(scope);
ScopedString name(scope);
- next(name.getRef(), &index, &p, &attrs);
+ next(name.getRef(), &index, p, &attrs);
if (attrs.isEmpty())
return Encode::null();