diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-23 00:04:55 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-23 00:04:55 (GMT) |
commit | 30379e098ef31a8a1f670bdeab212ed419e80b5b (patch) | |
tree | 9da0cbf97ffc6088aaca11432099dfffa4d9e6d5 /src/declarative/qml | |
parent | 5085d5027f168db01e60e2161d44d9445f9c7beb (diff) | |
parent | a720a5942d17705e01c43a840f582c8970a2f5e4 (diff) | |
download | Qt-30379e098ef31a8a1f670bdeab212ed419e80b5b.zip Qt-30379e098ef31a8a1f670bdeab212ed419e80b5b.tar.gz Qt-30379e098ef31a8a1f670bdeab212ed419e80b5b.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qmldom.cpp | 8 | ||||
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 9e12485..ce1bb93 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -151,7 +151,7 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl d->errors.clear(); d->imports.clear(); - QmlCompiledData component; + QmlCompiledData *component = new QmlCompiledData; QmlCompiler compiler; QmlCompositeTypeData *td = ((QmlEnginePrivate *)QmlEnginePrivate::get(engine))->typeManager.getImmediate(data, url); @@ -159,20 +159,23 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl if(td->status == QmlCompositeTypeData::Error) { d->errors = td->errors; td->release(); + component->release(); return false; } else if(td->status == QmlCompositeTypeData::Waiting) { QmlError error; error.setDescription(QLatin1String("QmlDomDocument supports local types only")); d->errors << error; td->release(); + component->release(); return false; } - compiler.compile(engine, td, &component); + compiler.compile(engine, td, component); if (compiler.isError()) { d->errors = compiler.errors(); td->release(); + component->release(); return false; } @@ -196,6 +199,7 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl d->root->addref(); } + component->release(); return true; } diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 23c0639..4be5230 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -209,7 +209,7 @@ QmlEnginePrivate::~QmlEnginePrivate() clear(bindValues[ii]); for(int ii = 0; ii < parserStatus.count(); ++ii) clear(parserStatus[ii]); - for(QHash<int, QmlCompiledData*>::ConstIterator iter = m_compositeTypes.begin(); iter != m_compositeTypes.end(); ++iter) + for(QHash<int, QmlCompiledData*>::ConstIterator iter = m_compositeTypes.constBegin(); iter != m_compositeTypes.constEnd(); ++iter) (*iter)->release(); } |