Commit: 3715b8d1d09d8b163cfea9ad22d92c89cc6e2368
Author: Sergey Sharybin
Date:   Thu Dec 18 19:02:06 2014 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rB3715b8d1d09d8b163cfea9ad22d92c89cc6e2368

Depsgraph: Correction to previous commit, it's unsafe to cast nodes

We shouldn't cast time source node to operation node and access the flag.

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

M       source/blender/depsgraph/intern/depsgraph_eval.cpp

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

diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cpp 
b/source/blender/depsgraph/intern/depsgraph_eval.cpp
index 2e9e02b..8ccb6e5 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cpp
@@ -111,22 +111,28 @@ void DEG_threaded_exit(void)
 
 static void calculate_pending_parents(Depsgraph *graph)
 {
-       for (Depsgraph::OperationNodes::const_iterator it_op = 
graph->operations.begin(); it_op != graph->operations.end(); ++it_op) {
+       for (Depsgraph::OperationNodes::const_iterator it_op = 
graph->operations.begin();
+            it_op != graph->operations.end();
+            ++it_op)
+       {
                OperationDepsNode *node = *it_op;
-               
+
                node->num_links_pending = 0;
                node->scheduled = false;
-               
+
                /* count number of inputs that need updates */
                if (node->flag & DEPSOP_FLAG_NEEDS_UPDATE) {
-                       for (OperationDepsNode::Relations::const_iterator 
it_rel = node->inlinks.begin(); it_rel != node->inlinks.end(); ++it_rel) {
+                       for (OperationDepsNode::Relations::const_iterator 
it_rel = node->inlinks.begin();
+                            it_rel != node->inlinks.end();
+                            ++it_rel)
+               {
                                DepsRelation *rel = *it_rel;
-                               OperationDepsNode *from = (OperationDepsNode 
*)rel->from;
-                               
-                               BLI_assert(ELEM(rel->from->type, 
DEPSNODE_TYPE_OPERATION,
-                                                                
DEPSNODE_TYPE_TIMESOURCE));
-                               if (from->flag & DEPSOP_FLAG_NEEDS_UPDATE)
-                                       ++node->num_links_pending;
+                               if (rel->from->type == DEPSNODE_TYPE_OPERATION) 
{
+                                       OperationDepsNode *from = 
(OperationDepsNode *)rel->from;
+                                       if (from->flag & 
DEPSOP_FLAG_NEEDS_UPDATE) {
+                                               ++node->num_links_pending;
+                                       }
+                               }
                        }
                }
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to