[Bf-blender-cvs] [c188ab7b67e] blender2.8: Depsgraph: Prevent non-expandable datablocks from being freed

Sergey Sharybin noreply at git.blender.org
Tue Mar 20 16:07:38 CET 2018


Commit: c188ab7b67e998f5ae972886be492d05b1d4485a
Author: Sergey Sharybin
Date:   Tue Mar 20 15:13:54 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBc188ab7b67e998f5ae972886be492d05b1d4485a

Depsgraph: Prevent non-expandable datablocks from being freed

This avoids original image datablock destruction when using
copy on write.

===================================================================

M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc

===================================================================

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index e7a9b4b5a69..bbf28a98aa2 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -374,6 +374,9 @@ void DepsgraphNodeBuilder::begin_build() {
 		cow_id_hash_ = BLI_ghash_ptr_new("Depsgraph id hash");
 		foreach (IDDepsNode *id_node, graph_->id_nodes) {
 			if (deg_copy_on_write_is_expanded(id_node->id_cow)) {
+				if (id_node->id_orig == id_node->id_cow) {
+					continue;
+				}
 				BLI_ghash_insert(cow_id_hash_,
 				                 id_node->id_orig,
 				                 id_node->id_cow);



More information about the Bf-blender-cvs mailing list