diff options
author | Bastien Montagne <bastien@blender.org> | 2020-10-02 17:12:27 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-10-02 18:40:51 +0300 |
commit | f3934523946962b807b0dd7e0863a437cfc56e27 (patch) | |
tree | 3566da5d6e4eb63816c7b56334821227d1b356de /source/blender/blenkernel/intern/armature.c | |
parent | 619e52eb82744c9dc2a403a0aa12fa9e9141fe3b (diff) |
Fix T81345, part two: crash in depsgraph when freeing COW armature.
Freeing of bones' IDproerties from Armature `free_data` callback would always
attempt to do user refcounting, which should never be done from that code.
This would generate crashes in depsgraph/COW context e.g.
Diffstat (limited to 'source/blender/blenkernel/intern/armature.c')
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index af9ce7c34ac..3d91d22e139 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -139,7 +139,7 @@ static void armature_free_data(struct ID *id) bArmature *armature = (bArmature *)id; BKE_armature_bone_hash_free(armature); - BKE_armature_bonelist_free(&armature->bonebase); + BKE_armature_bonelist_free(&armature->bonebase, false); /* free editmode data */ if (armature->edbo) { @@ -357,15 +357,15 @@ int BKE_armature_bonelist_count(ListBase *lb) return i; } -void BKE_armature_bonelist_free(ListBase *lb) +void BKE_armature_bonelist_free(ListBase *lb, const bool do_id_user) { Bone *bone; for (bone = lb->first; bone; bone = bone->next) { if (bone->prop) { - IDP_FreeProperty(bone->prop); + IDP_FreeProperty_ex(bone->prop, do_id_user); } - BKE_armature_bonelist_free(&bone->childbase); + BKE_armature_bonelist_free(&bone->childbase, do_id_user); } BLI_freelistN(lb); |