Previously you could have more states than sprites, which could lead to
errors because the sprite engine assumes bounds checking was done by the
state engine (which only knows the size of the states list).
Change-Id: Ie6069caa96d01cc28cc79350e6db5ff4191831a8
Reviewed-by: Martin Jones <martin.jones@nokia.com>
return;
//This could also trigger the start of the image loading in Sprites, however that currently happens in Sprite::setSource
+
+ QList<QQuickStochasticState*> removals;
+
foreach (QQuickStochasticState* s, m_states){
QQuickSprite* sprite = qobject_cast<QQuickSprite*>(s);
- if (sprite)
+ if (sprite) {
m_sprites << sprite;
- else
+ } else {
+ removals << s;
qDebug() << "Error: Non-sprite in QQuickSpriteEngine";
+ }
}
+ foreach (QQuickStochasticState* s, removals)
+ m_states.removeAll(s);
m_startedImageAssembly = true;
}