aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-04-13 15:43:40 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-04-17 10:07:51 +0000
commit0b394e30bba4f6bb7e6f7dbe5585a2e15aa0f21d (patch)
treeabe6f49793d5fd8b56c638e0767287888681d677
parent8ea8683ce8d8aaaf9811ffc339d057c1a57ae5b5 (diff)
Fix memory leak when calling instanceof on QML items
The return value of getType() has the ref count increased and needs handling on the caller side. Change-Id: I05ffa4dae221f2502f87b76762164bba1389db32 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/qml/qml/qqmltypewrapper.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp
index 6dbf6ad8c1..ce35e966aa 100644
--- a/src/qml/qml/qqmltypewrapper.cpp
+++ b/src/qml/qml/qqmltypewrapper.cpp
@@ -388,6 +388,7 @@ ReturnedValue QQmlTypeWrapper::instanceOf(const Object *typeObject, const Value
QQmlTypeData *td = qenginepriv->typeLoader.getType(typeWrapper->d()->type().sourceUrl());
CompiledData::CompilationUnit *cu = td->compilationUnit();
myQmlType = qenginepriv->metaObjectForType(cu->metaTypeId);
+ td->release();
} else {
myQmlType = qenginepriv->metaObjectForType(myTypeId);
}