aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp2
-rw-r--r--src/qml/qml/qqmltypeloader.cpp6
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;