diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2014-12-11 12:24:52 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-12-20 12:00:26 +0100 |
commit | 2fe06148f237d7a12a3c034cdfc3a6b923ea1df6 (patch) | |
tree | 62c6c90abb748b9e48ca6e3cdb01c3f0962f2f9e | |
parent | 234e933b1527510bc487435a9e46c4338d7b9701 (diff) |
Store a pointer to a heap object in the context wrapper
Change-Id: I2555e3e78e429260129d83894ca94d158c5e1704
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r-- | src/qml/qml/qqmlcontextwrapper.cpp | 4 | ||||
-rw-r--r-- | src/qml/qml/qqmlcontextwrapper_p.h | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp index 8d6cc662cb..7e386acd97 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<QQmlIdObjectsArray> a(scope, v4->memoryManager->alloc<QQmlIdObjectsArray>(v4, this)); - d()->idObjectsWrapper = a; + d()->idObjectsWrapper = v4->memoryManager->alloc<QQmlIdObjectsArray>(v4, this); } return d()->idObjectsWrapper->asReturnedValue(); } diff --git a/src/qml/qml/qqmlcontextwrapper_p.h b/src/qml/qml/qqmlcontextwrapper_p.h index 37283349d4..9dee1ef878 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(); |