diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-19 14:04:02 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-19 14:04:39 +0300 |
commit | b0c463a274564b82aa1a76659911dbe2780c0a17 (patch) | |
tree | ec0f765285fe24d99fe69a52f96efccff88bbefa | |
parent | 9b8d479e41492ce59f6cbf614098304aa3a22e4f (diff) |
Fix T57889: Crashes on undo and redo while working with image or image empty
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 5acb8a7b1eb..3353d42824d 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -104,6 +104,7 @@ extern "C" { #include "intern/builder/deg_builder.h" #include "intern/builder/deg_builder_pchanmap.h" +#include "intern/eval/deg_eval_copy_on_write.h" #include "intern/nodes/deg_node.h" #include "intern/nodes/deg_node_component.h" @@ -2488,12 +2489,15 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node Object *object = (Object *)id_orig; ID *object_data_id = (ID *)object->data; if (object_data_id != NULL) { - OperationKey data_copy_on_write_key(object_data_id, - DEG_NODE_TYPE_COPY_ON_WRITE, - DEG_OPCODE_COPY_ON_WRITE); - DepsRelation *rel = add_relation( - data_copy_on_write_key, copy_on_write_key, "Eval Order"); - rel->flag |= DEPSREL_FLAG_GODMODE; + if (deg_copy_on_write_is_needed(object_data_id)) { + OperationKey data_copy_on_write_key(object_data_id, + DEG_NODE_TYPE_COPY_ON_WRITE, + DEG_OPCODE_COPY_ON_WRITE); + DepsRelation *rel = add_relation(data_copy_on_write_key, + copy_on_write_key, + "Eval Order"); + rel->flag |= DEPSREL_FLAG_GODMODE; + } } else { BLI_assert(object->type == OB_EMPTY); |