diff options
Diffstat (limited to 'src/declarative/qml/qmlcompileddata.cpp')
-rw-r--r-- | src/declarative/qml/qmlcompileddata.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlcompileddata.cpp b/src/declarative/qml/qmlcompileddata.cpp index de9bf96..48a0893 100644 --- a/src/declarative/qml/qmlcompileddata.cpp +++ b/src/declarative/qml/qmlcompileddata.cpp @@ -161,8 +161,8 @@ int QmlCompiledData::indexForLocation(const QmlParser::LocationSpan &l) return rv; } -QmlCompiledData::QmlCompiledData() -: importCache(0), root(0), rootPropertyCache(0) +QmlCompiledData::QmlCompiledData(QmlEngine *engine) +: QmlCleanup(engine), importCache(0), root(0), rootPropertyCache(0) { } @@ -189,6 +189,17 @@ QmlCompiledData::~QmlCompiledData() qDeleteAll(cachedClosures); } +void QmlCompiledData::clear() +{ + qDeleteAll(cachedPrograms); + qDeleteAll(cachedClosures); + for (int ii = 0; ii < cachedClosures.count(); ++ii) + cachedClosures[ii] = 0; + for (int ii = 0; ii < cachedPrograms.count(); ++ii) + cachedPrograms[ii] = 0; +} + + QObject *QmlCompiledData::TypeReference::createInstance(QmlContext *ctxt, const QBitField &bindings) const { if (type) { |