[Bf-blender-cvs] [55527d83e29] blender2.8: Depsgraph: Allow stealing copy-on-written pointer

Sergey Sharybin noreply at git.blender.org
Thu Jul 27 15:23:05 CEST 2017


Commit: 55527d83e2986c46cb6e89b8d0eec17a15e0ab12
Author: Sergey Sharybin
Date:   Thu Jul 27 14:42:06 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB55527d83e2986c46cb6e89b8d0eec17a15e0ab12

Depsgraph: Allow stealing copy-on-written pointer

This will become handy when we'll be re-using evaluated meshes for
objects after relations are updated.

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

M	source/blender/depsgraph/intern/nodes/deg_node.cc

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

diff --git a/source/blender/depsgraph/intern/nodes/deg_node.cc b/source/blender/depsgraph/intern/nodes/deg_node.cc
index e7fca5ac541..8706ec94d52 100644
--- a/source/blender/depsgraph/intern/nodes/deg_node.cc
+++ b/source/blender/depsgraph/intern/nodes/deg_node.cc
@@ -218,7 +218,7 @@ void IDDepsNode::destroy()
 
 #ifdef WITH_COPY_ON_WRITE
 	/* Free memory used by this CoW ID. */
-	if (id_cow != id_orig) {
+	if (id_cow != id_orig && id_cow != NULL) {
 		deg_free_copy_on_write_datablock(id_cow);
 		MEM_freeN(id_cow);
 		DEG_COW_PRINT("Destroy CoW for %s: id_orig=%p id_cow=%p\n",




More information about the Bf-blender-cvs mailing list