aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativepropertycache.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-09-05 17:31:41 +1000
committerQt by Nokia <qt-info@nokia.com>2011-09-29 06:12:49 +0200
commit703c808a5649169dd6b9605af273374cd62951d1 (patch)
tree7248cc72bfa632a51c814d6622f0b12a7f2bd443 /src/declarative/qml/qdeclarativepropertycache.cpp
parent600e56ad053362dd5d4150f5dec6b93c2fee575b (diff)
Asynchronous component instantiation
This introduces two main: * the QML compiler executes in a separate thread * item instantiation can be interrupted and resumed to allow it to be split across multiple frames. Task-number: QTBUG-21151 Change-Id: I9631c62bb77da3a2e0c37f0da3719533fdce4fef Reviewed-on: http://codereview.qt-project.org/5676 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativepropertycache.cpp')
-rw-r--r--src/declarative/qml/qdeclarativepropertycache.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp
index e35fa52eed..6337750335 100644
--- a/src/declarative/qml/qdeclarativepropertycache.cpp
+++ b/src/declarative/qml/qdeclarativepropertycache.cpp
@@ -200,7 +200,7 @@ void QDeclarativePropertyCache::Data::lazyLoad(const QMetaMethod &m)
Creates a new empty QDeclarativePropertyCache.
*/
QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e)
-: QDeclarativeCleanup(e), engine(e), parent(0), propertyIndexCacheStart(0), methodIndexCacheStart(0)
+: engine(e), parent(0), propertyIndexCacheStart(0), methodIndexCacheStart(0)
{
Q_ASSERT(engine);
}
@@ -209,7 +209,7 @@ QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e)
Creates a new QDeclarativePropertyCache of \a metaObject.
*/
QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e, const QMetaObject *metaObject)
-: QDeclarativeCleanup(e), engine(e), parent(0), propertyIndexCacheStart(0), methodIndexCacheStart(0)
+: engine(e), parent(0), propertyIndexCacheStart(0), methodIndexCacheStart(0)
{
Q_ASSERT(engine);
Q_ASSERT(metaObject);
@@ -223,6 +223,16 @@ QDeclarativePropertyCache::~QDeclarativePropertyCache()
if (parent) parent->release();
parent = 0;
+ engine = 0;
+}
+
+void QDeclarativePropertyCache::destroy()
+{
+ Q_ASSERT(engine || constructor.IsEmpty());
+ if (constructor.IsEmpty())
+ delete this;
+ else
+ QDeclarativeEnginePrivate::deleteInEngineThread(engine, this);
}
// This is inherited from QDeclarativeCleanup, so it should only clear the things
@@ -305,8 +315,7 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb
Data::Flag propertyFlags, Data::Flag methodFlags, Data::Flag signalFlags)
{
Q_UNUSED(revision);
-
- qPersistentDispose(constructor); // Now invalid
+ Q_ASSERT(constructor.IsEmpty()); // We should not be appending to an in-use property cache
bool dynamicMetaObject = isDynamicMetaObject(metaObject);