summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcontext.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-08-10 05:37:19 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-08-10 08:01:37 (GMT)
commit8c3405bbf65826f0ab0be0bd090d723f8efaa3af (patch)
treef6886a2b8a86f567b98728bba9cdc3d1be780dcf /src/declarative/qml/qmlcontext.cpp
parent12ffa33ddc725cd94662a383af6e1793049c807c (diff)
downloadQt-8c3405bbf65826f0ab0be0bd090d723f8efaa3af.zip
Qt-8c3405bbf65826f0ab0be0bd090d723f8efaa3af.tar.gz
Qt-8c3405bbf65826f0ab0be0bd090d723f8efaa3af.tar.bz2
Abstract expression and binding APIs
By splitting the interface through which the system interacts with bindings away from a specific implementation, we can introduce highly specialized implementations for specific optimizations. This commit also includes a sample optimization for object properties being assigned directly from a local id.
Diffstat (limited to 'src/declarative/qml/qmlcontext.cpp')
-rw-r--r--src/declarative/qml/qmlcontext.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp
index 18ba906..451dbcc 100644
--- a/src/declarative/qml/qmlcontext.cpp
+++ b/src/declarative/qml/qmlcontext.cpp
@@ -47,6 +47,7 @@
#include <qscriptengine.h>
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qdebug.h>
+#include <private/qmlbindingoptimizations_p.h>
// 6-bits
#define MAXIMUM_DEFAULT_OBJECTS 63
@@ -82,6 +83,9 @@ void QmlContextPrivate::destroyed(ContextGuard *guard)
if (parent && QObjectPrivate::get(parent)->wasDeleted)
return;
+ while(guard->bindings)
+ guard->bindings->reset();
+
for (int ii = 0; ii < idValueCount; ++ii) {
if (&idValues[ii] == guard) {
QMetaObject::activate(q, ii + notifyIndex, 0);
@@ -276,13 +280,13 @@ QmlContext::~QmlContext()
(*iter)->d_func()->parent = 0;
}
- QmlExpressionPrivate *expression = d->expressions;
+ QmlAbstractExpression *expression = d->expressions;
while (expression) {
- QmlExpressionPrivate *nextExpression = expression->nextExpression;
+ QmlAbstractExpression *nextExpression = expression->m_nextExpression;
- expression->ctxt = 0;
- expression->prevExpression = 0;
- expression->nextExpression = 0;
+ expression->m_context = 0;
+ expression->m_prevExpression = 0;
+ expression->m_nextExpression = 0;
expression = nextExpression;
}