diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-27 13:06:10 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-02 17:11:28 +0100 |
commit | 52dc3f6937d51046424b232323189dfb41cc09c7 (patch) | |
tree | b74c0e6bb30f7dcec9e599b88dd9b7637db7914c /src/qml | |
parent | 5c9a0f61c74724d571b56bdbac486594066ff5e8 (diff) |
[new compiler] Fix tst_qqmlengine::trimComponentCache
Fix bug in QQmlCompiledData refcounting.
Change-Id: I09528419c602d3173db2f13c516d2f0d79abd92e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 53689775c6..68d128d79a 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -200,6 +200,8 @@ QObject *QQmlObjectCreator::create(int subComponentIndex, QObject *parent) if (instance) { QQmlData *ddata = QQmlData::get(instance); Q_ASSERT(ddata); + if (ddata->compiledData) + ddata->compiledData->release(); ddata->compiledData = compiledData; ddata->compiledData->addref(); diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 75f983d9e8..c1074e8a84 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -1975,6 +1975,12 @@ QQmlTypeData::~QQmlTypeData() m_scripts.at(ii).script->release(); for (int ii = 0; ii < m_types.count(); ++ii) if (m_types.at(ii).typeData) m_types.at(ii).typeData->release(); + for (QHash<int, TypeReference>::ConstIterator it = m_resolvedTypes.constBegin(), end = m_resolvedTypes.constEnd(); + it != end; ++it) { + if (QQmlTypeData *tdata = it->typeData) + tdata->release(); + } + if (m_compiledData) m_compiledData->release(); delete m_implicitImport; |