diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-02-18 12:44:24 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-02-19 15:27:44 +0100 |
commit | d4f3445bb050bbc34f0e86832fca9b7047041c1e (patch) | |
tree | b41aa20f7cd8d9f95628373172c5042979157906 /src/qml/qml/qqmlimport.cpp | |
parent | 2eb5b3f5c5f32404b8cb4ebb1d65ed5d5781b9f3 (diff) |
Avoid memory leaks for inline component types
When a QQmlType is constructed from a QQmlTypePrivate, the latter's
refcount is incremented. We decrement it again, as the QQmlType should
be its sole owner.
Change-Id: Id6ab618e06b49c10e3888c694113536caed7f058
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlimport.cpp')
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index 80eafdf146..3a06e98b6b 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -724,6 +724,7 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedSt Q_ASSERT(ok); typePriv->extraData.id->url = QUrl(this->url); auto icType = QQmlType(typePriv); + typePriv->release(); return icType; }; if (containingType.isValid()) { |