mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 05:07:51 -06:00
FIX: smooth_nodes may crash due to broken parent-child chain
Change-Id: I770df691b41c6f18a0cb97e49e9e2251afe02e1a (cherry picked from commit 2b5cdf0337fff277f7b949da568d6cdaa28a0d35)
This commit is contained in:
parent
8d7fb45164
commit
5df5cb9ff4
1 changed files with 5 additions and 1 deletions
|
@ -3000,7 +3000,11 @@ void TreeSupport::drop_nodes(std::vector<std::vector<Node*>>& contact_nodes)
|
|||
std::vector<Node*>::iterator to_erase = std::find(contact_nodes[i_layer].begin(), contact_nodes[i_layer].end(), i_node);
|
||||
if (to_erase != contact_nodes[i_layer].end())
|
||||
{
|
||||
to_free_node_set.insert(*to_erase);
|
||||
// update the parent-child chain
|
||||
if(i_node->parent)
|
||||
i_node->parent->child = i_node->child;
|
||||
if(i_node->child)
|
||||
i_node->child->parent = i_node->parent;
|
||||
contact_nodes[i_layer].erase(to_erase);
|
||||
to_free_node_set.insert(i_node);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue