diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-20 09:22:50 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-20 09:22:50 (GMT) |
commit | 6ed6b740e1ea9cfa64990bb2805d37197f4da45e (patch) | |
tree | d437fd6a8d0ab74ae399a22a7fa35351d19213ed /src/declarative/qml/qmlexpression.cpp | |
parent | c0a02f5c67d3de5e16fd506df83fef968e09c798 (diff) | |
download | Qt-6ed6b740e1ea9cfa64990bb2805d37197f4da45e.zip Qt-6ed6b740e1ea9cfa64990bb2805d37197f4da45e.tar.gz Qt-6ed6b740e1ea9cfa64990bb2805d37197f4da45e.tar.bz2 |
Prevent expression evaluation data from overlapping
Diffstat (limited to 'src/declarative/qml/qmlexpression.cpp')
-rw-r--r-- | src/declarative/qml/qmlexpression.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp index b4f57eb..ea0e9aa 100644 --- a/src/declarative/qml/qmlexpression.cpp +++ b/src/declarative/qml/qmlexpression.cpp @@ -347,7 +347,11 @@ QVariant QmlExpression::value() QmlBasicScript::CacheState cacheState = QmlBasicScript::Reset; QmlEnginePrivate *ep = engine()->d_func(); + QmlExpression *lastCurrentExpression = ep->currentExpression; + QPODVector<QmlEnginePrivate::CapturedProperty> lastCapturedProperties; + ep->capturedProperties.copyAndClear(lastCapturedProperties); + ep->currentExpression = this; if (d->sse.isValid()) { @@ -364,7 +368,7 @@ QVariant QmlExpression::value() d->updateGuards(ep->capturedProperties); } - ep->capturedProperties.clear(); + lastCapturedProperties.copyAndClear(ep->capturedProperties); return rv; } @@ -471,6 +475,7 @@ void QmlExpressionPrivate::clearGuards() void QmlExpressionPrivate::updateGuards(const QPODVector<QmlEnginePrivate::CapturedProperty> &properties) { + //clearGuards(); Q_Q(QmlExpression); static int notifyIdx = -1; @@ -499,7 +504,7 @@ void QmlExpressionPrivate::updateGuards(const QPODVector<QmlEnginePrivate::Captu needGuard = false; ++hit; } - } else if(guardList[ii].data()) { + } else if(guardList[ii].data() && !guardList[ii].isDuplicate) { // Cache miss QMetaObject::disconnect(guardList[ii].data(), guardList[ii].notifyIndex, @@ -548,7 +553,7 @@ void QmlExpressionPrivate::updateGuards(const QPODVector<QmlEnginePrivate::Captu } for (int ii = properties.count(); ii < guardListLength; ++ii) { - if (guardList[ii].data()) { + if (guardList[ii].data() && !guardList[ii].isDuplicate) { QMetaObject::disconnect(guardList[ii].data(), guardList[ii].notifyIndex, q, notifyIdx); @@ -560,7 +565,6 @@ void QmlExpressionPrivate::updateGuards(const QPODVector<QmlEnginePrivate::Captu guardList = newGuardList; guardListLength = properties.count(); } - //qWarning() << hit << properties.count() << q->expression(); } /*! |