Skip to content

Commit 2cdaaa2

Browse files
committed
Fix member init order for min_bead_width_
min_bead_width_ was initialized before min_even_wall_line_width_ and min_odd_wall_line_width_, causing undefined behavior due to C++ member initialization order following declaration order, not initializer list order. Reordered both the declaration and the initializer list to fix this.
1 parent b226085 commit 2cdaaa2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

include/WallToolPaths.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ class WallToolPaths
127127
coord_t wall_0_inset_; //<! How far to inset the outer wall. Should only be applied when printing the actual walls, not extra infill/skin/support walls.
128128
bool print_thin_walls_; //<! Whether to enable the widening beading meta-strategy for thin features
129129
coord_t min_feature_size_; //<! The minimum size of the features that can be widened by the widening beading meta-strategy. Features thinner than that will not be printed
130-
coord_t min_bead_width_; //<! The minimum bead size to use when widening thin model features with the widening beading meta-strategy
131130
const AngleRadians wall_transition_angle_;
132131
const coord_t wall_transition_length_;
133132
const double min_even_wall_line_width_;
134133
const double wall_line_width_0_;
135134
const double min_odd_wall_line_width_;
135+
coord_t min_bead_width_; //<! The minimum bead size to use when widening thin model features with the widening beading meta-strategy
136136
const double wall_line_width_x_;
137137
const int wall_distribution_count_;
138138
const coord_t wall_transition_filter_distance_;

src/WallToolPaths.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ WallToolPaths::WallToolPaths(
3737
, wall_0_inset_(wall_0_inset)
3838
, print_thin_walls_(settings.get<bool>("fill_outline_gaps"))
3939
, min_feature_size_(nominal_bead_width / 4)
40-
, min_bead_width_(std::min(min_even_wall_line_width_, min_odd_wall_line_width_))
4140
, wall_transition_angle_(AngleDegrees(10))
4241
, wall_transition_length_(nominal_bead_width)
4342
, min_even_wall_line_width_(std::llrint(nominal_bead_width * 0.85))
4443
, wall_line_width_0_(nominal_bead_width)
4544
, min_odd_wall_line_width_(min_even_wall_line_width_)
45+
, min_bead_width_(std::min(min_even_wall_line_width_, min_odd_wall_line_width_))
4646
, wall_line_width_x_(nominal_bead_width)
4747
, wall_distribution_count_(1)
4848
, wall_transition_filter_distance_(MM2INT(100))

0 commit comments

Comments
 (0)