ProjectExplorer: clearer destruction of ToolChainNodes

Change-Id: I7f03d5649230eaa0dd6c54281a10e04f14a8526c
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
hjk
2012-10-22 10:01:49 +02:00
committed by Tobias Hunger
parent 8c980f5a4e
commit 60ffb91ffd

View File

@@ -73,13 +73,16 @@ public:
~ToolChainNode() ~ToolChainNode()
{ {
if (parent)
parent->childNodes.removeOne(this);
qDeleteAll(childNodes);
// Do not delete tool chain, we do not own it. // Do not delete tool chain, we do not own it.
Q_ASSERT(childNodes.isEmpty()); for (int i = childNodes.size(); --i >= 0; ) {
ToolChainNode *child = childNodes.at(i);
child->parent = 0;
delete child;
}
if (parent)
parent->childNodes.removeOne(this);
} }
ToolChainNode *parent; ToolChainNode *parent;