diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-09-25 11:39:25 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-09-25 21:42:48 +0200 |
commit | d9e7e24c6635a6cafaff681981ff0579d5313418 (patch) | |
tree | f644566767325ba6ab2bad5c9511bbdcf3bf45c2 /src/qml/qml/qqmltypedata.cpp | |
parent | c734eb3a8bda3b24721d80c380189c5e754a9b38 (diff) |
Don't leak resolved types of failed compilations
If the compilation fails QQmlTypeCompiler::compile() returns nullptr. In
that case, there is no ExecutableCompilationUnit to own the resolved
types. Therefore, delete them.
Change-Id: Ia8f4ef78438642cb064538c7266ca636ec7eb0c1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltypedata.cpp')
-rw-r--r-- | src/qml/qml/qqmltypedata.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/qml/qqmltypedata.cpp b/src/qml/qml/qqmltypedata.cpp index b9fbf40e96..5e85d7f692 100644 --- a/src/qml/qml/qqmltypedata.cpp +++ b/src/qml/qml/qqmltypedata.cpp @@ -614,6 +614,8 @@ void QQmlTypeData::compile(const QQmlRefPointer<QQmlTypeNameCache> &typeNameCach QQmlTypeCompiler compiler(enginePrivate, this, m_document.data(), typeNameCache, resolvedTypeCache, dependencyHasher); m_compiledData = compiler.compile(); if (!m_compiledData) { + qDeleteAll(*resolvedTypeCache); + resolvedTypeCache->clear(); setError(compiler.compilationErrors()); return; } |