aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 41eb6fe5ec..6257d8bac9 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -673,12 +673,16 @@ void ExecutionEngine::requireArgumentsAccessors(int n)
if (n <= argumentsAccessors.size())
return;
+ Scope scope(this);
+ ScopedFunctionObject get(scope);
+ ScopedFunctionObject set(scope);
+
uint oldSize = argumentsAccessors.size();
argumentsAccessors.resize(n);
for (int i = oldSize; i < n; ++i) {
- FunctionObject *get = new (memoryManager) ArgumentsGetterFunction(rootContext, i);
- FunctionObject *set = new (memoryManager) ArgumentsSetterFunction(rootContext, i);
- Property pd = Property::fromAccessor(get, set);
+ get = new (memoryManager) ArgumentsGetterFunction(rootContext, i);
+ set = new (memoryManager) ArgumentsSetterFunction(rootContext, i);
+ Property pd = Property::fromAccessor(get.getPointer(), set.getPointer());
argumentsAccessors[i] = pd;
}
}