[Bf-blender-cvs] [1ad4b85] master: Fix T38224: Blender crashes on duplicating curve

Sergey Sharybin noreply at git.blender.org
Wed Jan 15 11:28:16 CET 2014


Commit: 1ad4b85e8f1e06cbbf9523146cafd37d9d2d1fd1
Author: Sergey Sharybin
Date:   Wed Jan 15 16:25:28 2014 +0600
https://developer.blender.org/rB1ad4b85e8f1e06cbbf9523146cafd37d9d2d1fd1

Fix T38224: Blender crashes on duplicating curve

Issue is caused by the evaluation flags getter called with
NULL depsgraph. It happens on direct object update from the
transform code after duplicating the curve.

Proper solution is probably to make sure depsgraph is rebuild
after duplication, but for now it's better to prevent crashes.

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

M	source/blender/blenkernel/intern/depsgraph.c

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

diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 539ed8f..dd1f953 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2910,7 +2910,17 @@ const char *DAG_get_node_name(void *node_v)
 
 short DAG_get_eval_flags_for_object(struct Scene *scene, void *object)
 {
-	DagNode *node = dag_find_node(scene->theDag, object);
+	DagNode *node = NULL;
+
+	if (scene->theDag) {
+		/* DAG happens to be NULL when doing direct object update
+		 * during transform after duplication, see T38224.
+		 *
+		 * Not sure whether such a NULL check will always work,
+		 * but for now it's better than crash anyway.
+		 */
+		dag_find_node(scene->theDag, object);
+	}
 
 	if (node) {
 		return node->eval_flags;




More information about the Bf-blender-cvs mailing list