Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
Description
In QQmlPropertyCacheCreator we want to guarantee that the type data of loaded components is completed before retrieving their compilation unit. However, there is in fact no way to do so because the property cache creator runs on the type loader thread and completion can only be signaled on the engine thread. Therefore, there is a TODO in the code that needs to be addressed:
// compositeType may not be the same type as qmlType because multiple engines // may load different types for the same document. Therefore we have to ask // our engine's type loader here. QQmlRefPointer<QQmlTypeData> tdata = enginePrivate->typeLoader.getType(qmltype.sourceUrl()); Q_ASSERT(tdata); // TODO: We would like to guarantee completion here, but getType() actually // only guarantees completion when called on the engine thread. compositeType = tdata->compilationUnit()->qmlTypeForComponent();
There used to be an assert in the same place which didn't seem to trigger in practice. However, it's hard to prove that this code path cannot be taken if the type data isn't complete.