From: Lars Knoll Date: Thu, 11 Dec 2014 11:24:52 +0000 (+0100) Subject: Store a pointer to a heap object in the context wrapper X-Git-Tag: v5.5.90+alpha1~630 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2fe06148f237d7a12a3c034cdfc3a6b923ea1df6;p=platform%2Fupstream%2Fqtdeclarative.git Store a pointer to a heap object in the context wrapper Change-Id: I2555e3e78e429260129d83894ca94d158c5e1704 Reviewed-by: Simon Hausmann --- diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp index 8d6cc66..7e386ac 100644 --- a/src/qml/qml/qqmlcontextwrapper.cpp +++ b/src/qml/qml/qqmlcontextwrapper.cpp @@ -397,9 +397,7 @@ ReturnedValue QmlContextWrapper::idObjectsArray() { if (!d()->idObjectsWrapper) { ExecutionEngine *v4 = engine(); - Scope scope(v4); - Scoped a(scope, v4->memoryManager->alloc(v4, this)); - d()->idObjectsWrapper = a; + d()->idObjectsWrapper = v4->memoryManager->alloc(v4, this); } return d()->idObjectsWrapper->asReturnedValue(); } diff --git a/src/qml/qml/qqmlcontextwrapper_p.h b/src/qml/qml/qqmlcontextwrapper_p.h index 3728334..9dee1ef 100644 --- a/src/qml/qml/qqmlcontextwrapper_p.h +++ b/src/qml/qml/qqmlcontextwrapper_p.h @@ -61,11 +61,12 @@ namespace CompiledData { struct Function; } -struct QQmlIdObjectsArray; struct QmlContextWrapper; namespace Heap { +struct QQmlIdObjectsArray; + struct QmlContextWrapper : Object { QmlContextWrapper(QV8Engine *engine, QQmlContextData *context, QObject *scopeObject, bool ownsContext = false); ~QmlContextWrapper();