Ugh, yet another try to fix [#18697] 2.49RC1: Keyed Particles fine in viewport but give me a crash during render.

Hopefully it's now fixed for good.
This commit is contained in:
2009-05-11 19:19:36 +00:00
parent c24a81a293
commit 0aeaf08242
2 changed files with 12 additions and 2 deletions

View File

@@ -351,8 +351,18 @@ void free_hair(ParticleSystem *psys, int softbody)
}
void free_keyed_keys(ParticleSystem *psys)
{
if(psys->particles && psys->particles->keys)
ParticleData *pa;
int i;
if(psys->particles && psys->particles->keys) {
MEM_freeN(psys->particles->keys);
for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++)
if(pa->keys) {
pa->keys= NULL;
pa->totkey= 0;
}
}
}
void free_child_path_cache(ParticleSystem *psys)
{

View File

@@ -203,7 +203,7 @@ static void realloc_particles(Object *ob, ParticleSystem *psys, int new_totpart)
if(psys->particles->keys)
MEM_freeN(psys->particles->keys);
for(i=totsaved, pa=psys->particles+totsaved; i<psys->totpart; i++, pa++)
for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++)
if(pa->keys) {
pa->keys= NULL;
pa->totkey= 0;