aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypeloader.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-06-06 12:39:38 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-06-07 03:31:56 +0000
commit921c1e0e4f6f00f449136f116c6fc5f55fbf1df6 (patch)
tree3e2675db2f393bb1b70680ef1d618d4894cdcedb /src/qml/qml/qqmltypeloader.cpp
parentffce29dc2036f26dff8142978cb4e86e869cd38f (diff)
Another manual refcounting cleanup
There is little reason to use manual reference counting for an encapsulated member. Change-Id: I024a6ff700872da6837954a5167e502487e9b12c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltypeloader.cpp')
-rw-r--r--src/qml/qml/qqmltypeloader.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 87036d9ea4..3cbbaf4129 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -2008,7 +2008,7 @@ QQmlTypeData::TypeDataCallback::~TypeDataCallback()
QQmlTypeData::QQmlTypeData(const QUrl &url, QQmlTypeLoader *manager)
: QQmlTypeLoader::Blob(url, QmlFile, manager),
- m_typesResolved(false), m_compiledData(0), m_implicitImport(0), m_implicitImportLoaded(false)
+ m_typesResolved(false), m_implicitImport(0), m_implicitImportLoaded(false)
{
}
@@ -2026,9 +2026,6 @@ QQmlTypeData::~QQmlTypeData()
if (QQmlTypeData *tdata = it->typeData)
tdata->release();
}
-
- if (m_compiledData)
- m_compiledData->release();
}
const QList<QQmlTypeData::ScriptReference> &QQmlTypeData::resolvedScripts() const
@@ -2048,7 +2045,7 @@ const QList<QQmlTypeData::TypeReference> &QQmlTypeData::compositeSingletons() co
QV4::CompiledData::CompilationUnit *QQmlTypeData::compilationUnit() const
{
- return m_compiledData;
+ return m_compiledData.data();
}
void QQmlTypeData::registerCallback(TypeDataCallback *callback)
@@ -2301,14 +2298,13 @@ QString QQmlTypeData::stringAt(int index) const
void QQmlTypeData::compile()
{
- Q_ASSERT(m_compiledData == 0);
+ Q_ASSERT(m_compiledData.isNull());
QQmlTypeCompiler compiler(QQmlEnginePrivate::get(typeLoader()->engine()), this, m_document.data());
m_compiledData = compiler.compile();
- if (m_compiledData) {
- m_compiledData->addref();
- } else {
+ if (!m_compiledData) {
setError(compiler.compilationErrors());
+ return;
}
}