From: Michael Brasser Date: Wed, 30 Nov 2011 06:03:10 +0000 (+1000) Subject: Don't update dependent anchors on destruction unless required. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=f304dd6fbb9d901c0a72609dc3c384eab4935f93;p=konrad%2Fqtdeclarative.git Don't update dependent anchors on destruction unless required. Change-Id: Ic088e800d5bbad0a819824a21b4c0bf430126786 Reviewed-by: Martin Jones --- diff --git a/src/declarative/items/qquickitem.cpp b/src/declarative/items/qquickitem.cpp index 161404f..9c11196 100644 --- a/src/declarative/items/qquickitem.cpp +++ b/src/declarative/items/qquickitem.cpp @@ -1755,10 +1755,13 @@ QQuickItem::~QQuickItem() anchor->clearItem(this); } - // XXX todo - the original checks if the parent is being destroyed + /* + update item anchors that depended on us unless they are our child (and will also be destroyed), + or our sibling, and our parent is also being destroyed. + */ for (int ii = 0; ii < d->changeListeners.count(); ++ii) { QQuickAnchorsPrivate *anchor = d->changeListeners.at(ii).listener->anchorPrivate(); - if (anchor && anchor->item && anchor->item->parent() != this) //child will be deleted anyway + if (anchor && anchor->item && anchor->item->parentItem() && anchor->item->parentItem() != this) anchor->update(); }