Fix for [#23970] Memory problem when setting hair amount to zero

This commit is contained in:
Janne Karhu 2010-09-24 07:39:52 +00:00
parent 6a4b9298c8
commit 361bd506dc
1 changed files with 5 additions and 3 deletions

View File

@ -195,9 +195,11 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
psys->free_edit = NULL;
}
newpars= MEM_callocN(totpart*sizeof(ParticleData), "particles");
if(psys->part->phystype == PART_PHYS_BOIDS)
newboids= MEM_callocN(totpart*sizeof(BoidParticle), "boid particles");
if(totpart) {
newpars= MEM_callocN(totpart*sizeof(ParticleData), "particles");
if(psys->part->phystype == PART_PHYS_BOIDS)
newboids= MEM_callocN(totpart*sizeof(BoidParticle), "boid particles");
}
if(psys->particles) {
totsaved=MIN2(psys->totpart,totpart);