aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlmodels/qqmltableinstancemodel_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-03-25 15:52:10 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-03-27 12:29:29 +0100
commit0b2c04215dcdb0f209c46abe24c63deaaffc471c (patch)
tree5fcdf8476053ab55b30f09440190c8a228d998e0 /src/qmlmodels/qqmltableinstancemodel_p.h
parentc64013079908e0d6ce90d565fbeaed7816c236ff (diff)
QQmlTableInstanceModel: Restore draining behavior of Qt 5.14
In Qt 5.14 model items are directly deleted when draining the reusable items pool, rather than calling deleteLater() on them. This may be slightly more efficient and due to some unknown side effect the deleteLater() call creates a memory leak. Restore the direct delete in drainReusableItems(). Fixes: QTBUG-82000 Change-Id: Ia1027b1004c04e8aceaa5ff16a600849c46bf470 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/qmlmodels/qqmltableinstancemodel_p.h')
-rw-r--r--src/qmlmodels/qqmltableinstancemodel_p.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qmlmodels/qqmltableinstancemodel_p.h b/src/qmlmodels/qqmltableinstancemodel_p.h
index 95d945f979..0d96d35a5e 100644
--- a/src/qmlmodels/qqmltableinstancemodel_p.h
+++ b/src/qmlmodels/qqmltableinstancemodel_p.h
@@ -124,6 +124,11 @@ public:
int indexOf(QObject *, QObject *) const override { Q_UNREACHABLE(); return 0; }
private:
+ enum DestructionMode {
+ Deferred,
+ Immediate
+ };
+
QQmlComponent *resolveDelegate(int index);
QQmlAdaptorModel m_adaptorModel;
@@ -141,7 +146,7 @@ private:
void deleteIncubationTaskLater(QQmlIncubator *incubationTask);
void deleteAllFinishedIncubationTasks();
QQmlDelegateModelItem *resolveModelItem(int index);
- void destroyModelItem(QQmlDelegateModelItem *modelItem);
+ void destroyModelItem(QQmlDelegateModelItem *modelItem, DestructionMode mode);
void dataChangedCallback(const QModelIndex &begin, const QModelIndex &end, const QVector<int> &roles);