Fix for [#23970] Memory problem when setting hair amount to zero
This commit is contained in:
parent
6a4b9298c8
commit
361bd506dc
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue