summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-08-25 17:03:10 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-26 00:37:45 +0200
commit6dd1ab81e1c7943053feea321b6f7774b688ee5d (patch)
treef58a5820910b80774aea0ec01e93b3df4c173c27
parent59440312401f7fc26d4b60a5c3966154c8b43f27 (diff)
Fix memory leak in ListModel custom parser
ModelNodes created by the parser for ListElement definitions were not deleted. (cherry picked from commit c1491c356f3cca92a359468ce37f38bc1873eec4) Task-number: QTBUG-21084 Change-Id: Ic55a054bb8e30cdabd11080e4f827df5deb1a014 Reviewed-on: http://codereview.qt.nokia.com/3567 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp1
-rw-r--r--src/qtquick1/util/qdeclarativelistmodel.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index 15d87c828d..da841c1618 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -932,6 +932,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;
diff --git a/src/qtquick1/util/qdeclarativelistmodel.cpp b/src/qtquick1/util/qdeclarativelistmodel.cpp
index d5aa75bec5..08e15c52b6 100644
--- a/src/qtquick1/util/qdeclarativelistmodel.cpp
+++ b/src/qtquick1/util/qdeclarativelistmodel.cpp
@@ -787,6 +787,7 @@ void QDeclarative1ListModelParser::setCustomData(QObject *obj, const QByteArray
QDeclarative1ListModel *rv = static_cast<QDeclarative1ListModel *>(obj);
ModelNode *root = new ModelNode(rv->m_nested);
+ rv->m_nested->m_ownsRoot = true;
rv->m_nested->_root = root;
QStack<ModelNode *> nodes;
nodes << root;