summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-09-01 04:00:16 (GMT)
committerBea Lam <bea.lam@nokia.com>2011-09-01 04:00:16 (GMT)
commit340c22999d9f9678c9035c1dc372423e970b8ca7 (patch)
tree684a60a0fd828e6efee7257dc06307b640997419 /src/declarative
parent7ba3250a1e6cf54c1cacbdf71ac57befd66eed90 (diff)
downloadQt-340c22999d9f9678c9035c1dc372423e970b8ca7.zip
Qt-340c22999d9f9678c9035c1dc372423e970b8ca7.tar.gz
Qt-340c22999d9f9678c9035c1dc372423e970b8ca7.tar.bz2
Fix memory leak in ListModel custom parser
ModelNodes created by the parser for ListElement definitions were not deleted. (Commit backported from c1491c356f3cca92a359468ce37f38bc1873eec4 in qt-qml-staging) Task-number: QTBUG-21084 Change-Id: I36ca0ffba1a94355abe42a95e49723548d9a575a Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index d0c8cc8..92aa6d0 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -784,6 +784,7 @@ void QDeclarativeListModelParser::setCustomData(QObject *obj, const QByteArray &
QDeclarativeListModel *rv = static_cast<QDeclarativeListModel *>(obj);
ModelNode *root = new ModelNode(rv->m_nested);
+ rv->m_nested->m_ownsRoot = true;
rv->m_nested->_root = root;
QStack<ModelNode *> nodes;
nodes << root;