From 0b394e30bba4f6bb7e6f7dbe5585a2e15aa0f21d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 13 Apr 2018 15:43:40 +0200 Subject: 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 --- src/qml/qml/qqmltypewrapper.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/qml/qml') 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); } -- cgit v1.2.3