From e4fc75edaedead3092aace3a29a0aafdd0e86a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20H=C3=A4nel?= Date: Mon, 3 Jun 2013 13:40:09 +0200 Subject: Fix null-pointer access in QQuickVisualDataModelPrivate I observed null cachItem->contextData which lead to null-pointer access on cacheItem->contextData->destroy(). Task-number: QTBUG-31439 Change-Id: I91f28a3ee1ac83446ecde1801a1cb7962fb883f3 Reviewed-by: Alan Alpert --- src/qml/types/qqmldelegatemodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 279e2ea884..747c9391e9 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -854,7 +854,8 @@ void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incuba delete cacheItem->object; cacheItem->object = 0; cacheItem->scriptRef -= 1; - cacheItem->contextData->destroy(); + if (cacheItem->contextData) + cacheItem->contextData->destroy(); cacheItem->contextData = 0; if (!cacheItem->isReferenced()) { -- cgit v1.2.3