freeing particle modifier would access freed memory (only to tak the psys to be deleted), set to NULL after freeing and check before tagging.

This commit is contained in:
2010-01-03 04:35:51 +00:00
parent eb7ac3146e
commit bf6fc75161
2 changed files with 5 additions and 1 deletions

View File

@@ -6866,7 +6866,10 @@ static void particleSystemModifier_freeData(ModifierData *md)
psmd->dm=0;
}
psmd->psys->flag |= PSYS_DELETE;
/* ED_object_modifier_remove may have freed this first before calling
* modifier_free (which calls this function) */
if(psmd->psys)
psmd->psys->flag |= PSYS_DELETE;
}
static void particleSystemModifier_copyData(ModifierData *md, ModifierData *target)
{

View File

@@ -165,6 +165,7 @@ int ED_object_modifier_remove(ReportList *reports, Scene *scene, Object *ob, Mod
BLI_remlink(&ob->particlesystem, psmd->psys);
psys_free(ob, psmd->psys);
psmd->psys= NULL;
}
else if(md->type == eModifierType_Softbody) {
if(ob->soft) {