forked from qt-creator/qt-creator
ProjectExplorer: clearer destruction of ToolChainNodes
Change-Id: I7f03d5649230eaa0dd6c54281a10e04f14a8526c Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user