only reallocate memory for child particles if the size changes.

This commit is contained in:
Campbell Barton 2010-01-20 11:32:11 +00:00
parent 6307c65534
commit d99d68684b

@ -263,6 +263,12 @@ static int get_psys_tot_child(struct Scene *scene, ParticleSystem *psys)
static void alloc_child_particles(ParticleSystem *psys, int tot)
{
if(psys->child){
/* only re-allocate if we have to */
if(psys->part->childtype && psys->totchild == tot) {
memset(psys->child, 0, tot*sizeof(ChildParticle));
return;
}
MEM_freeN(psys->child);
psys->child=0;
psys->totchild=0;