Fix null-pointer access in QQuickVisualDataModelPrivate
authorFlorian Hänel <florian.haenel@basyskom.com>
Mon, 3 Jun 2013 11:40:09 +0000 (13:40 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 7 Jun 2013 19:28:59 +0000 (21:28 +0200)
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 <aalpert@blackberry.com>

src/qml/types/qqmldelegatemodel.cpp

index 279e2ea..747c939 100644 (file)
@@ -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()) {