aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2016-09-09 16:20:57 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-10-06 14:46:21 +0000
commit57c9d6969ac474177c77d5ea59768b39620a3b2f (patch)
treed7fab7663b43af13f7551e9360a588594b7d21cf /src/qml/types
parent6c05fe9cb760a9a26d7a1a8037aa62966a3bd344 (diff)
QML: Also check for correct destroy() chaining
Check that the destroy() method of Heap::Base was called when a Managed object needs destruction. This checks if a call to the parent's destroy() method was accidentally omitted. Change-Id: Id025ecd6d4744bf3eab23503fbe317ed2a461138 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp2
-rw-r--r--src/qml/types/qqmllistmodel_p_p.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 395a3e5641..9b58ec35f8 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -78,6 +78,7 @@ struct QQmlDelegateModelGroupChangeArray : Object {
void init(const QVector<QQmlChangeSet::Change> &changes);
void destroy() {
delete changes;
+ Object::destroy();
}
QVector<QQmlChangeSet::Change> *changes;
@@ -1872,6 +1873,7 @@ DEFINE_OBJECT_VTABLE(QQmlDelegateModelItemObject);
void QV4::Heap::QQmlDelegateModelItemObject::destroy()
{
item->Dispose();
+ Object::destroy();
}
diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h
index bd2102679b..6e17b55e79 100644
--- a/src/qml/types/qqmllistmodel_p_p.h
+++ b/src/qml/types/qqmllistmodel_p_p.h
@@ -168,6 +168,7 @@ struct ModelObject : public QObjectWrapper {
m_model = model;
m_elementIndex = elementIndex;
}
+ void destroy() { QObjectWrapper::destroy(); }
QQmlListModel *m_model;
int m_elementIndex;
};