diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-05-29 19:05:27 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-05-31 06:55:20 +0000 |
commit | e5c76615b72abcae628ca7561c16eab71f1d3a0e (patch) | |
tree | 6c4f9c1b3b8205681512a2d51f1e54569a762177 /src/qml/qml | |
parent | af028f592b4934cbd92c42d94ee405f764edfb80 (diff) |
Move dependent scripts to QV4::CompiledData::CompilationUnit
Change-Id: I85e8267ce4cd26ae83fe567357e1368658fdb43d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlcompileddata.cpp | 3 | ||||
-rw-r--r-- | src/qml/qml/qqmlcompiler_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 8 |
3 files changed, 4 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlcompileddata.cpp b/src/qml/qml/qqmlcompileddata.cpp index 405bf57448..b25792054c 100644 --- a/src/qml/qml/qqmlcompileddata.cpp +++ b/src/qml/qml/qqmlcompileddata.cpp @@ -84,9 +84,6 @@ QQmlCompiledData::~QQmlCompiledData() } qDeleteAll(resolvedTypes); resolvedTypes.clear(); - - for (int ii = 0; ii < scripts.count(); ++ii) - scripts.at(ii)->release(); } void QQmlCompiledData::clear() diff --git a/src/qml/qml/qqmlcompiler_p.h b/src/qml/qml/qqmlcompiler_p.h index 75a6835ae6..2c9e04d5e0 100644 --- a/src/qml/qml/qqmlcompiler_p.h +++ b/src/qml/qml/qqmlcompiler_p.h @@ -120,8 +120,6 @@ public: // map from name index QHash<int, TypeReference*> resolvedTypes; - QList<QQmlScriptData *> scripts; - QQmlRefPointer<QV4::CompiledData::CompilationUnit> compilationUnit; bool isInitialized() const { return hasEngine(); } diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 289ce4849d..dcd35bccad 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -183,12 +183,12 @@ QObject *QQmlObjectCreator::create(int subComponentIndex, QObject *parent, QQmlI if (topLevelCreator) sharedState->allJavaScriptObjects = scope.alloc(compiledData->compilationUnit->totalObjectCount); - if (subComponentIndex == -1 && compiledData->scripts.count()) { - QV4::ScopedObject scripts(scope, v4->newArrayObject(compiledData->scripts.count())); + if (subComponentIndex == -1 && compiledData->compilationUnit->dependentScripts.count()) { + QV4::ScopedObject scripts(scope, v4->newArrayObject(compiledData->compilationUnit->dependentScripts.count())); context->importedScripts.set(v4, scripts); QV4::ScopedValue v(scope); - for (int i = 0; i < compiledData->scripts.count(); ++i) { - QQmlScriptData *s = compiledData->scripts.at(i); + for (int i = 0; i < compiledData->compilationUnit->dependentScripts.count(); ++i) { + QQmlScriptData *s = compiledData->compilationUnit->dependentScripts.at(i); scripts->putIndexed(i, (v = s->scriptValueForContext(context))); } } else if (sharedState->creationContext) { |