diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-05-18 17:29:01 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-05-18 17:29:16 +0300 |
commit | a3070474e29d6e17e5055397741c70c4dc166ace (patch) | |
tree | ee031424effe2fdcfa4bbfd935ef3261ed4aeeb9 /source/blender/depsgraph/intern | |
parent | db2c966e2c8e66f0de6caa3e4a1a5a96bcfbf843 (diff) |
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.
Diffstat (limited to 'source/blender/depsgraph/intern')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 40f9402abc8..c8b9702621e 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -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: |