aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2014-11-13 21:38:25 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-21 19:32:23 +0100
commit2784a68d64519ccc5d01b6c1378207572cf1ebcd (patch)
treeb66287687e7311a24253d60e18bcba829fb475ad /src/qml/types
parent2cb6d1bf32e017026f618dcfdbef3980f5363656 (diff)
Cleanup destruction of heap objects
Generate the code from a macro instead of duplicating boiler plate code. Operate on Heap::Base instead of Managed. Change-Id: I84c5a705980899be3e5b931a093645e50d3923bf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp11
-rw-r--r--src/qml/types/qqmldelegatemodel_p_p.h3
2 files changed, 2 insertions, 12 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index ac85f6b2d6..fcbf474008 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -1888,12 +1888,6 @@ QV4::Heap::QQmlDelegateModelItemObject::~QQmlDelegateModelItemObject()
item->Dispose();
}
-void QQmlDelegateModelItemObject::destroy(Managed *that)
-{
- static_cast<QQmlDelegateModelItemObject *>(that)->d()->~Data();
-}
-
-
QQmlDelegateModelItem::QQmlDelegateModelItem(
QQmlDelegateModelItemMetaType *metaType, int modelIndex)
@@ -3276,6 +3270,7 @@ DEFINE_OBJECT_VTABLE(QQmlDelegateModelGroupChange);
struct QQmlDelegateModelGroupChangeArray : public QV4::Object
{
V4_OBJECT2(QQmlDelegateModelGroupChangeArray, QV4::Object)
+ V4_NEEDS_DESTROY
public:
static QV4::Heap::QQmlDelegateModelGroupChangeArray *create(QV4::ExecutionEngine *engine, const QVector<QQmlChangeSet::Change> &changes)
{
@@ -3323,10 +3318,6 @@ public:
return Object::get(m, name, hasProperty);
}
- static void destroy(Managed *that) {
- static_cast<QQmlDelegateModelGroupChangeArray *>(that)->d()->~Data();
- }
-
};
QV4::Heap::QQmlDelegateModelGroupChangeArray::QQmlDelegateModelGroupChangeArray(QV4::ExecutionEngine *engine, const QVector<QQmlChangeSet::Change> &changes)
diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h
index 191eabb543..8635795820 100644
--- a/src/qml/types/qqmldelegatemodel_p_p.h
+++ b/src/qml/types/qqmldelegatemodel_p_p.h
@@ -165,8 +165,7 @@ struct QQmlDelegateModelItemObject : Object {
struct QQmlDelegateModelItemObject : QV4::Object
{
V4_OBJECT2(QQmlDelegateModelItemObject, QV4::Object)
-
- static void destroy(Managed *that);
+ V4_NEEDS_DESTROY
};
QV4::Heap::QQmlDelegateModelItemObject::QQmlDelegateModelItemObject(QV4::ExecutionEngine *engine, QQmlDelegateModelItem *item)