From: Alan Alpert Date: Tue, 13 Sep 2011 03:44:23 +0000 (+1000) Subject: Remove invalid ASSERT X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=a99671f7b83ed68dfac727ed0b09a8afaa1326c9;p=konrad%2Fqtdeclarative.git 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 --- 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()