summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlpropertycache.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-10-26 04:47:03 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-10-26 04:47:03 (GMT)
commit64ca67183569a1a3b9dc1410dac5bbe8d5f56bb5 (patch)
tree2f6b2af80225ab3903f0cd53b9774783a652f760 /src/declarative/qml/qmlpropertycache.cpp
parent570fa7aece0ce149c22f7b804093f70c7cb1c999 (diff)
parentbace980199f6578ef453c57128fe7f0659bfeddf (diff)
downloadQt-64ca67183569a1a3b9dc1410dac5bbe8d5f56bb5.zip
Qt-64ca67183569a1a3b9dc1410dac5bbe8d5f56bb5.tar.gz
Qt-64ca67183569a1a3b9dc1410dac5bbe8d5f56bb5.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml/qmlpropertycache.cpp')
-rw-r--r--src/declarative/qml/qmlpropertycache.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlpropertycache.cpp b/src/declarative/qml/qmlpropertycache.cpp
index e00126f..3ede341 100644
--- a/src/declarative/qml/qmlpropertycache.cpp
+++ b/src/declarative/qml/qmlpropertycache.cpp
@@ -86,12 +86,18 @@ void QmlPropertyCache::Data::load(const QMetaMethod &m)
}
-QmlPropertyCache::QmlPropertyCache()
+QmlPropertyCache::QmlPropertyCache(QmlEngine *engine)
+: QmlCleanup(engine)
{
}
QmlPropertyCache::~QmlPropertyCache()
{
+ clear();
+}
+
+void QmlPropertyCache::clear()
+{
for (int ii = 0; ii < indexCache.count(); ++ii)
indexCache.at(ii)->release();
@@ -102,6 +108,10 @@ QmlPropertyCache::~QmlPropertyCache()
for (IdentifierCache::ConstIterator iter = identifierCache.begin();
iter != identifierCache.end(); ++iter)
(*iter)->release();
+
+ indexCache.clear();
+ stringCache.clear();
+ identifierCache.clear();
}
QmlPropertyCache::Data QmlPropertyCache::create(const QMetaObject *metaObject,
@@ -141,7 +151,7 @@ QmlPropertyCache *QmlPropertyCache::create(QmlEngine *engine, const QMetaObject
Q_ASSERT(engine);
Q_ASSERT(metaObject);
- QmlPropertyCache *cache = new QmlPropertyCache;
+ QmlPropertyCache *cache = new QmlPropertyCache(engine);
QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);