aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qqmllistmodel.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-01-29 13:01:21 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-01-29 13:01:22 +0100
commit1e421097f08876f5e2242be6f7a20db2aeb51692 (patch)
treec45b9323368cfdede67facd43c076a85322f12f6 /src/qml/types/qqmllistmodel.cpp
parentf4788a13e98aa4e5438327094524d7b8239893ec (diff)
parent666bc731a0ba930ca0cfda18daf836913fd91361 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Diffstat (limited to 'src/qml/types/qqmllistmodel.cpp')
-rw-r--r--src/qml/types/qqmllistmodel.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index b2507fb99e..91eef2d982 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -2276,6 +2276,9 @@ QQmlV4Handle QQmlListModel::get(int index) const
} else {
QObject *object = m_listModel->getOrCreateModelObject(const_cast<QQmlListModel *>(this), index);
result = scope.engine->memoryManager->allocObject<QV4::ModelObject>(object, const_cast<QQmlListModel *>(this), index);
+ // Keep track of the QObjectWrapper in persistent value storage
+ QV4::Value *val = scope.engine->memoryManager->m_weakValues->allocate();
+ *val = result;
}
}