nodeview: clear edges first

This commit is contained in:
itsmattkc
2022-01-05 11:37:17 -08:00
parent d3ffeaa35a
commit 50b29146f3
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -44,6 +44,13 @@ NodeViewContext::NodeViewContext(Node *context, QGraphicsItem *item) :
connect(context_, &Node::NodeRemovedFromContext, this, &NodeViewContext::RemoveChild, Qt::DirectConnection);
}
NodeViewContext::~NodeViewContext()
{
// Delete edges before items, because the edge constructor references the items
qDeleteAll(edges_);
edges_.clear();
}
void NodeViewContext::AddChild(Node *node)
{
if (!context_) {