Clear the ParticleSettings pointer to prevent doubly-freeing it

Not happy with the approach, as it adds to nested_id_hack_discard_pointers(),
but at least it fixes a crash.
This commit is contained in:
Sybren A. Stüvel 2018-05-18 16:29:01 +02:00
parent db2c966e2c
commit a3070474e2
1 changed files with 9 additions and 0 deletions

View File

@ -135,6 +135,15 @@ void nested_id_hack_discard_pointers(ID *id_cow)
SPECIAL_CASE(ID_LT, Lattice, key)
SPECIAL_CASE(ID_ME, Mesh, key)
case ID_OB:
{
/* Clear the ParticleSettings pointer to prevent doubly-freeing it. */
Object *ob = (Object *)id_cow;
LISTBASE_FOREACH(ParticleSystem *, psys, &ob->particlesystem) {
psys->part = NULL;
}
break;
}
# undef SPECIAL_CASE
default: