aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-12-05 15:27:00 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-05 10:13:00 +0100
commit1817efd1ddaf459e5e2b001c7aa81522e13e7098 (patch)
tree3a36b30d90b3df832a35cb939607385697682059 /src
parent42ba473b3a1af1d6e0579dfc0ddb6c571c76d6c0 (diff)
Don't attempt to destroy a null persisted item.
Persisted items are still only constructed on demand so we can't assume the object is non null. Change-Id: I1ce9563eb3b9fb1ae611e8afcf9c8c74f0563aec Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickvisualdatamodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquickvisualdatamodel.cpp b/src/quick/items/qquickvisualdatamodel.cpp
index 649ca6f96b..4bb061f295 100644
--- a/src/quick/items/qquickvisualdatamodel.cpp
+++ b/src/quick/items/qquickvisualdatamodel.cpp
@@ -1398,7 +1398,7 @@ void QQuickVisualDataModelPrivate::itemsRemoved(
} else {
for (; cacheIndex < remove.cacheIndex + remove.count - removedCache; ++cacheIndex) {
QQuickVisualDataModelCacheItem *cacheItem = m_cache.at(cacheIndex);
- if (remove.inGroup(Compositor::Persisted) && cacheItem->objectRef == 0) {
+ if (remove.inGroup(Compositor::Persisted) && cacheItem->objectRef == 0 && cacheItem->object) {
destroy(cacheItem->object);
if (QDeclarativePackage *package = qobject_cast<QDeclarativePackage *>(cacheItem->object))
emitDestroyingPackage(package);