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>
This commit is contained in:
Simon Hausmann 2018-04-13 15:43:40 +02:00
parent 8ea8683ce8
commit 0b394e30bb
1 changed files with 1 additions and 0 deletions

View File

@ -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);
}