diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-08-11 03:58:08 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-08-11 03:58:08 (GMT) |
commit | e8d3e8e0b93271bb41fcdc264fc10ec59be5aa20 (patch) | |
tree | 72e288ac19dd7051f862f7dc552d866d3f4024b9 | |
parent | c170e75cd3af746cfec80ff7d5feb44228a329c3 (diff) | |
download | Qt-e8d3e8e0b93271bb41fcdc264fc10ec59be5aa20.zip Qt-e8d3e8e0b93271bb41fcdc264fc10ec59be5aa20.tar.gz Qt-e8d3e8e0b93271bb41fcdc264fc10ec59be5aa20.tar.bz2 |
Compile on Symbian
Task-number: QTBUG-12771
-rw-r--r-- | src/declarative/util/qdeclarativelistmodel.cpp | 12 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativelistmodel_p_p.h | 12 |
2 files changed, 10 insertions, 14 deletions
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index b0d47a9..20fe3a9 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -1209,16 +1209,22 @@ ModelNode::ModelNode() ModelNode::~ModelNode() { - qDeleteAll(properties.values()); + clear(); + if (modelCache) { modelCache->m_nested->_root = 0/* ==this */; delete modelCache; modelCache = 0; } + if (objectCache) { delete objectCache; objectCache = 0; } +} +void ModelNode::clear() +{ ModelNode *node; for (int ii = 0; ii < values.count(); ++ii) { node = qvariant_cast<ModelNode *>(values.at(ii)); if (node) { delete node; node = 0; } } + values.clear(); - if (modelCache) { modelCache->m_nested->_root = 0/* ==this */; delete modelCache; modelCache = 0; } - if (objectCache) { delete objectCache; objectCache = 0; } + qDeleteAll(properties.values()); + properties.clear(); } void ModelNode::setObjectValue(const QScriptValue& valuemap) { diff --git a/src/declarative/util/qdeclarativelistmodel_p_p.h b/src/declarative/util/qdeclarativelistmodel_p_p.h index c41f016..8231414 100644 --- a/src/declarative/util/qdeclarativelistmodel_p_p.h +++ b/src/declarative/util/qdeclarativelistmodel_p_p.h @@ -158,17 +158,7 @@ struct ModelNode QList<QVariant> values; QHash<QString, ModelNode *> properties; - void clear() { - ModelNode *node; - for (int ii = 0; ii < values.count(); ++ii) { - node = qvariant_cast<ModelNode *>(values.at(ii)); - if (node) { delete node; node = 0; } - } - values.clear(); - - qDeleteAll(properties.values()); - properties.clear(); - } + void clear(); QDeclarativeListModel *model(const NestedListModel *model) { if (!modelCache) { |