Free crash when freeing object caches from duplicator

This commit is contained in:
Sergey Sharybin 2018-06-26 10:47:35 +02:00
parent ea339dc62c
commit cfb50463be
1 changed files with 9 additions and 2 deletions

View File

@ -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