Make sure polish() is reentrant.
Take a copy of the items currently scheduled for polish (and clear the internal list) to ensure an item can re-add itself to the polish list during an updatePolish(). Change-Id: I0c629795f64d5926ac87a838ea5e216b6a1fa6cf Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
This commit is contained in:
parent
e99c5a3f11
commit
a60635a3cf
|
@ -197,10 +197,11 @@ void QQuickCanvas::focusInEvent(QFocusEvent *)
|
|||
|
||||
void QQuickCanvasPrivate::polishItems()
|
||||
{
|
||||
while (!itemsToPolish.isEmpty()) {
|
||||
QSet<QQuickItem *>::Iterator iter = itemsToPolish.begin();
|
||||
QQuickItem *item = *iter;
|
||||
itemsToPolish.erase(iter);
|
||||
QSet<QQuickItem *> itms = itemsToPolish;
|
||||
itemsToPolish.clear();
|
||||
|
||||
for (QSet<QQuickItem *>::iterator it = itms.begin(); it != itms.end(); ++it) {
|
||||
QQuickItem *item = *it;
|
||||
QQuickItemPrivate::get(item)->polishScheduled = false;
|
||||
item->updatePolish();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue