From e964fc34269bc2087fb3246172a1890224a160bd Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 11 Oct 2013 12:26:27 +0200 Subject: 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 --- src/qml/jsruntime/qv4engine.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/qml/jsruntime/qv4engine.cpp') 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; } } -- cgit v1.2.3