Avoid crash on exit
authorAlan Alpert <alan.alpert@nokia.com>
Mon, 4 Jul 2011 04:51:24 +0000 (14:51 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 4 Jul 2011 05:00:04 +0000 (07:00 +0200)
QSParticlePainter could call QSGItem::mapFromItem while the scene was
being destroyed.

Change-Id: If9356dae6aadf97b853c2aaf51870751bbbab711
Reviewed-on: http://codereview.qt.nokia.com/1023
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones
src/declarative/particles/qsgparticlepainter.cpp

index cf1d3c2..34313bd 100644 (file)
@@ -172,7 +172,7 @@ int QSGParticlePainter::particleTypeIndex(QSGParticleData* d)
 
 void QSGParticlePainter::calcSystemOffset()
 {
-    if(!m_system)
+    if (!m_system || !parentItem())
         return;
     QPointF lastOffset = m_systemOffset;
     m_systemOffset = -1 * this->mapFromItem(m_system, QPointF());