From a99671f7b83ed68dfac727ed0b09a8afaa1326c9 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 13 Sep 2011 13:44:23 +1000 Subject: [PATCH] Remove invalid ASSERT There is a possibility for it to have been updated already if newDatums are requested before emittersChanged is reached. This became possible when emitters stopped having strict particle emission limits. Change-Id: I45d1564f56547418127446e3138ff21deec891c3 Reviewed-on: http://codereview.qt-project.org/4753 Reviewed-by: Qt Sanity Bot Reviewed-by: Martin Jones --- src/declarative/particles/qsgparticlesystem.cpp | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/declarative/particles/qsgparticlesystem.cpp b/src/declarative/particles/qsgparticlesystem.cpp index bc27073..7d70c3b 100644 --- a/src/declarative/particles/qsgparticlesystem.cpp +++ b/src/declarative/particles/qsgparticlesystem.cpp @@ -850,8 +850,11 @@ void QSGParticleSystem::emittersChanged() m_particle_count += m_groupData[i]->size(); } - Q_ASSERT(m_particle_count >= m_bySysIdx.size());//XXX when GC done right - m_bySysIdx.resize(m_particle_count); + if (m_debugMode) + qDebug() << "Particle system emitters changed. New particle count: " << m_particle_count; + + if (m_particle_count > m_bySysIdx.size())//New datum requests haven't updated it + m_bySysIdx.resize(m_particle_count); foreach (QSGParticlePainter *p, m_painters) loadPainter(p); @@ -859,8 +862,6 @@ void QSGParticleSystem::emittersChanged() if (!m_groups.isEmpty()) createEngine(); - if (m_debugMode) - qDebug() << "Particle system emitters changed. New particle count: " << m_particle_count; } void QSGParticleSystem::createEngine() -- 1.7.2.5