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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user