nodeview: remove from attached items when removing node

This commit is contained in:
itsmattkc
2021-09-27 11:10:31 -07:00
parent 407407491f
commit c7bcf4ecad
+7
View File
@@ -980,6 +980,13 @@ void NodeView::OpenSelectedNodeInViewer()
void NodeView::RemoveNode(Node *node)
{
for (auto it=attached_items_.begin(); it!=attached_items_.end(); ) {
if (it->item->GetNode() == node) {
it = attached_items_.erase(it);
} else {
it++;
}
}
for (const Node::OutputConnection &oc : node->output_connections()) {
scene_.RemoveEdge(oc.first, oc.second);
}