[Bf-blender-cvs] [d1202bd641c] blender-v3.1-release: Fix T95620: Crash When Entering Edit Mode on a Curve

Hans Goudey noreply at git.blender.org
Wed Feb 9 18:06:18 CET 2022


Commit: d1202bd641ca2652fac9620bc06dad757584b1e0
Author: Hans Goudey
Date:   Wed Feb 9 11:06:10 2022 -0600
Branches: blender-v3.1-release
https://developer.blender.org/rBd1202bd641ca2652fac9620bc06dad757584b1e0

Fix T95620: Crash When Entering Edit Mode on a Curve

Under some circumstances, simply adding a curve object and going
to edit mode would cause a crash. This is because the evaluated
`CurveEval` was accessed but also freed by the dependency graph.

The fix reverts the part of b76918717dbfd8363f that uses the
`CurveEval` for the curve object bounds. While this isn't ideal,
it was the previous behavior, and some unexpected behavior
with object bounds is much better than a crash. Plus, given the plans
of using the new "Curves" data-block for evaluated curves, this
situation will change relatively soon anyway.

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

M	source/blender/blenkernel/intern/curve.cc

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

diff --git a/source/blender/blenkernel/intern/curve.cc b/source/blender/blenkernel/intern/curve.cc
index f83a672b2ee..c611e280793 100644
--- a/source/blender/blenkernel/intern/curve.cc
+++ b/source/blender/blenkernel/intern/curve.cc
@@ -5072,16 +5072,6 @@ void BKE_curve_nurb_vert_active_validate(Curve *cu)
 
 bool BKE_curve_minmax(Curve *cu, bool use_radius, float min[3], float max[3])
 {
-  if (cu->curve_eval != nullptr) {
-    float3 eval_min(FLT_MAX);
-    float3 eval_max(-FLT_MAX);
-    if (cu->curve_eval->bounds_min_max(eval_min, eval_max, false)) {
-      copy_v3_v3(min, eval_min);
-      copy_v3_v3(max, eval_max);
-      return true;
-    }
-  }
-
   ListBase *nurb_lb = BKE_curve_nurbs_get(cu);
   ListBase temp_nurb_lb = {nullptr, nullptr};
   const bool is_font = (BLI_listbase_is_empty(nurb_lb)) && (cu->len != 0);



More information about the Bf-blender-cvs mailing list