diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-26 11:47:35 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-26 11:53:05 +0300 |
commit | cfb50463bef8a5c91daaa48cb0e84c4f6bb65ea7 (patch) | |
tree | 1d105aa86ff297a111f56654c2fc03be99d0355b /source | |
parent | ea339dc62c37b891b8b0c0a8e56f7848b3de5fe9 (diff) |
Free crash when freeing object caches from duplicator
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 773b191111a..f31aa36de5f 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -404,8 +404,15 @@ void BKE_object_free_caches(Object *object) } } - BKE_object_free_derived_caches(object); - update_flag |= OB_RECALC_DATA; + /* NOTE: If object ios copming from a duplicator, it might be a temporary + * object created by dependency graph, which shares pointers with original + * object. + * In this case we can not free anything. + */ + if ((object->base_flag & BASE_FROMDUPLI) == 0) { + BKE_object_free_derived_caches(object); + update_flag |= OB_RECALC_DATA; + } /* Tag object for update, so once memory critical operation is over and * scene update routines are back to it's business the object will be |