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:
parent
8ea8683ce8
commit
0b394e30bb
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue