Skip to content

Commit

Permalink
FIX: hybrid tree support crash in some case
Browse files Browse the repository at this point in the history
jira: STUDIO-8313
Change-Id: Ide03d8f666232f457305f3dd298bf8151ba9c57b
  • Loading branch information
ArthurBambulab authored and lanewei120 committed Oct 15, 2024
1 parent 658c0a5 commit 35bf682
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libslic3r/Support/TreeSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3663,7 +3663,10 @@ const ExPolygons& TreeSupportData::calculate_avoidance(const RadiusLayerPair& ke
const auto &radius = key.radius;
const auto &layer_nr = key.layer_nr;
if (layer_nr == 0) {
m_avoidance_cache[key] = get_collision(radius, 0);
// avoid ExPolygons:~ExPolygons() in multi-threading case, as it's not thread-safe and may
// cause crash in some cases. See STUDIO-8313.
if (m_avoidance_cache.find(key) == m_avoidance_cache.end())
m_avoidance_cache[key] = get_collision(radius, 0);
return m_avoidance_cache[key];
}

Expand Down

0 comments on commit 35bf682

Please sign in to comment.