Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-03-28 10:16:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-28 10:16:07 +0300
commit46d980228b22b153416cd1223bb5fa3e766fac85 (patch)
tree62853481d4ca044b1f697e43c047f5eb021dbd40 /source/blender/blenkernel/intern/softbody.c
parent5b1980859ad20ad24a02589f4ad72a81a82df3ba (diff)
Fix T86992: Tagged ID deletion conflicts with freeing objects
Check LIB_TAG_COPIED_ON_WRITE instead of LIB_TAG_NO_MAIN, matching the behavior of rigid-body shared data.
Diffstat (limited to 'source/blender/blenkernel/intern/softbody.c')
-rw-r--r--source/blender/blenkernel/intern/softbody.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index de88e8a941c..d52e4443ac1 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -3181,9 +3181,11 @@ void sbFree(Object *ob)
return;
}
+ const bool is_orig = (ob->id.tag & LIB_TAG_COPIED_ON_WRITE) == 0;
+
free_softbody_intern(sb);
- if ((ob->id.tag & LIB_TAG_NO_MAIN) == 0) {
+ if (is_orig) {
/* Only free shared data on non-CoW copies */
BKE_ptcache_free_list(&sb->shared->ptcaches);
sb->shared->pointcache = NULL;