From c1491c356f3cca92a359468ce37f38bc1873eec4 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Thu, 25 Aug 2011 18:13:44 +1000 Subject: Fix memory leak in ListModel custom parser ModelNodes created by the parser for ListElement definitions were not deleted. Task-number: QTBUG-21084 Reviewed-by: Michael Brasser --- src/declarative/util/qdeclarativelistmodel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 28c2df6..9604117 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(obj); ModelNode *root = new ModelNode(rv->m_nested); + rv->m_nested->m_ownsRoot = true; rv->m_nested->_root = root; QStack nodes; nodes << root; -- cgit v0.12