When instantiating an anonymous component, we must also set the context
ownership to true.
Fixes garbage collection of item view delegates, where when the destructor
run, their context wasn't cleared properly and child items would re-evaluate
bindings that use "parent" with null.
Change-Id: I8c67c679c12ce987a0dec405571647270373881c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QQmlData *ddata = QQmlData::get(instance, /*create*/true);
ddata->setImplicitDestructible();
- if (static_cast<quint32>(index) == qmlUnit->indexOfRootObject) {
+ if (static_cast<quint32>(index) == qmlUnit->indexOfRootObject || ddata->rootObjectInCreation) {
if (ddata->context) {
Q_ASSERT(ddata->context != context);
Q_ASSERT(ddata->outerContext);