diff options
author | Liang Jian <jianliang79@gmail.com> | 2014-03-13 20:30:04 +0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-13 16:39:34 +0100 |
commit | ef635d410dada5c8eaa963d127ccb53eae3194fb (patch) | |
tree | 5828f2b3a8cae8cbf27c1e7343779d3f84133864 /src/qml/qml/qqmltypeloader.cpp | |
parent | d3bc2557e3a4dae686a80356d3d385f6b80924b6 (diff) |
Fix QQmlTypeData object leak
1) unref QQmlTypeData object stored in m_compositeSingletons
2) unref QQmlTypeData object in resolveQmlType()
Change-Id: I5f2e3a542637f62509c4a2f2ed8a6ba080eacf1b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmltypeloader.cpp')
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 258c5c71b3..5c48304b56 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -1966,12 +1966,17 @@ QQmlTypeData::QQmlTypeData(const QUrl &url, QQmlTypeLoader *manager) : QQmlTypeLoader::Blob(url, QmlFile, manager), m_typesResolved(false), m_compiledData(0), m_implicitImport(0), m_implicitImportLoaded(false) { + } QQmlTypeData::~QQmlTypeData() { for (int ii = 0; ii < m_scripts.count(); ++ii) m_scripts.at(ii).script->release(); + for (int ii = 0; ii < m_compositeSingletons.count(); ++ii) { + if (QQmlTypeData *tdata = m_compositeSingletons.at(ii).typeData) + tdata->release(); + } for (QHash<int, TypeReference>::ConstIterator it = m_resolvedTypes.constBegin(), end = m_resolvedTypes.constEnd(); it != end; ++it) { if (QQmlTypeData *tdata = it->typeData) |