diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest.cpp | 6 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8engine.cpp | 3 | ||||
-rw-r--r-- | src/qml/types/qqmllistmodel.cpp | 10 |
3 files changed, 6 insertions, 13 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index fe02c6633e..24f49eb6e7 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -117,10 +117,8 @@ class NodeImpl public: NodeImpl() : type(Element), document(0), parent(0) {} virtual ~NodeImpl() { - for (int ii = 0; ii < children.count(); ++ii) - delete children.at(ii); - for (int ii = 0; ii < attributes.count(); ++ii) - delete attributes.at(ii); + qDeleteAll(children); + qDeleteAll(attributes); } // These numbers are copied from the Node IDL definition diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index d322088f61..6949eb43e8 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -155,8 +155,7 @@ QV8Engine::QV8Engine(QJSEngine* qq) QV8Engine::~QV8Engine() { - for (int ii = 0; ii < m_extensionData.count(); ++ii) - delete m_extensionData[ii]; + qDeleteAll(m_extensionData); m_extensionData.clear(); qt_rem_qmlxmlhttprequest(m_v4Engine, m_xmlHttpRequestData); diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index 91eef2d982..44a4ff03e9 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -169,9 +169,7 @@ ListLayout::ListLayout(const ListLayout *other) : currentBlock(0), currentBlockO ListLayout::~ListLayout() { - for (int i=0 ; i < roles.count() ; ++i) { - delete roles[i]; - } + qDeleteAll(roles); } void ListLayout::sync(ListLayout *src, ListLayout *target) @@ -1662,8 +1660,7 @@ QQmlListModel::QQmlListModel(QQmlListModel *orig, QQmlListModelWorkerAgent *agen QQmlListModel::~QQmlListModel() { - for (int i=0 ; i < m_modelObjects.count() ; ++i) - delete m_modelObjects[i]; + qDeleteAll(m_modelObjects); if (m_primary) { m_listModel->destroy(); @@ -2007,8 +2004,7 @@ void QQmlListModel::clear() emitItemsAboutToBeRemoved(0, cleared); if (m_dynamicRoles) { - for (int i=0 ; i < m_modelObjects.count() ; ++i) - delete m_modelObjects[i]; + qDeleteAll(m_modelObjects); m_modelObjects.clear(); } else { m_listModel->clear(); |