Automatically disconnect all edges when a NodeParam is destroyed
If a NodeParam is destroyed (presumably as the result of its parent Node being destroyed), any edge objects connecting to another param should be destroyed or else the edge will be floating referencing a now destroyed object.
This commit is contained in:
@@ -37,6 +37,14 @@ NodeParam::NodeParam(const QString &id) :
|
||||
Q_ASSERT(!id_.isEmpty());
|
||||
}
|
||||
|
||||
NodeParam::~NodeParam()
|
||||
{
|
||||
// Clear all connected edges
|
||||
while (!edges_.isEmpty()) {
|
||||
DisconnectEdge(edges_.last());
|
||||
}
|
||||
}
|
||||
|
||||
const QString NodeParam::id()
|
||||
{
|
||||
return id_;
|
||||
|
||||
Reference in New Issue
Block a user