[Bf-blender-cvs] [978f2cb900b] blender-v3.0-release: Fix T89487: Crash adding Rigid Body to object with shared mesh data

Sergey Sharybin noreply at git.blender.org
Tue Nov 2 18:38:50 CET 2021


Commit: 978f2cb900b75110a3bc9dbcec9d4aeae5df4565
Author: Sergey Sharybin
Date:   Tue Nov 2 18:36:24 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB978f2cb900b75110a3bc9dbcec9d4aeae5df4565

Fix T89487: Crash adding Rigid Body to object with shared mesh data

Not sure why this bug was only discovered by such an elaborate steps
and why it took so long to be discovered. The root of the issue is
that in the 956c539e597a the typical flow of tag+flush+evaluate was
violated and tagging for visibility change happened after flush.

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

M	source/blender/depsgraph/intern/depsgraph_eval.cc
M	source/blender/depsgraph/intern/eval/deg_eval.cc

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

diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc
index cc7ce871419..0314219b725 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cc
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cc
@@ -44,6 +44,7 @@
 #include "intern/node/deg_node_time.h"
 
 #include "intern/depsgraph.h"
+#include "intern/depsgraph_tag.h"
 
 namespace deg = blender::deg;
 
@@ -54,6 +55,7 @@ static void deg_flush_updates_and_refresh(deg::Depsgraph *deg_graph)
     BKE_scene_frame_set(deg_graph->scene_cow, deg_graph->frame);
   }
 
+  deg::graph_tag_ids_for_visible_update(deg_graph);
   deg::deg_graph_flush_updates(deg_graph);
   deg::deg_evaluate_on_refresh(deg_graph);
 }
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc
index c816c7b8db5..d6877adb66b 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval.cc
@@ -370,8 +370,6 @@ static TaskPool *deg_evaluate_task_pool_create(DepsgraphEvalState *state)
  */
 void deg_evaluate_on_refresh(Depsgraph *graph)
 {
-  graph_tag_ids_for_visible_update(graph);
-
   /* Nothing to update, early out. */
   if (graph->entry_tags.is_empty()) {
     return;



More information about the Bf-blender-cvs mailing list