aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/particles
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-07-15 08:14:39 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-20 05:36:02 +0200
commita1867e5c6229e171b0fac3e57b96295221f2ea0a (patch)
tree4060190615c1bdf36d37a790e82bc5c67b06a50e /src/declarative/particles
parent522f0f92efcb1055081ab408c290d0452e4c6a14 (diff)
Crash less
Can't run any particles without a system set. Just skip the 'prepareFrame' function in that case. Task-Number: QTBUG-20386 Change-Id: I22332636084d1696d5aff5386a5ca4ff0f2f1866 Reviewed-on: http://codereview.qt.nokia.com/1680 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/particles')
-rw-r--r--src/declarative/particles/qsgitemparticle.cpp2
-rw-r--r--src/declarative/particles/qsgmodelparticle.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/declarative/particles/qsgitemparticle.cpp b/src/declarative/particles/qsgitemparticle.cpp
index 94603e9956..625c98ba61 100644
--- a/src/declarative/particles/qsgitemparticle.cpp
+++ b/src/declarative/particles/qsgitemparticle.cpp
@@ -165,6 +165,8 @@ QSGNode* QSGItemParticle::updatePaintNode(QSGNode* n, UpdatePaintNodeData* d)
void QSGItemParticle::prepareNextFrame()
{
+ if (!m_system)
+ return;
qint64 timeStamp = m_system->systemSync(this);
qreal curT = timeStamp/1000.0;
qreal dt = curT - m_lastT;
diff --git a/src/declarative/particles/qsgmodelparticle.cpp b/src/declarative/particles/qsgmodelparticle.cpp
index c649d743de..60c44381c7 100644
--- a/src/declarative/particles/qsgmodelparticle.cpp
+++ b/src/declarative/particles/qsgmodelparticle.cpp
@@ -227,6 +227,8 @@ QSGNode* QSGModelParticle::updatePaintNode(QSGNode* n, UpdatePaintNodeData* d)
void QSGModelParticle::prepareNextFrame()
{
+ if (!m_system)
+ return;
qint64 timeStamp = m_system->systemSync(this);
qreal curT = timeStamp/1000.0;
qreal dt = curT - m_lastT;