aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypeloader.cpp
diff options
context:
space:
mode:
authorLiang Jian <jianliang79@gmail.com>2014-03-13 20:30:04 +0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-13 16:39:34 +0100
commitef635d410dada5c8eaa963d127ccb53eae3194fb (patch)
tree5828f2b3a8cae8cbf27c1e7343779d3f84133864 /src/qml/qml/qqmltypeloader.cpp
parentd3bc2557e3a4dae686a80356d3d385f6b80924b6 (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.cpp5
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)