diff options
Diffstat (limited to 'src/declarative/qml/qdeclarativepropertycache.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativepropertycache.cpp | 17 |
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); |