nv50/ir: fix leak in removal of graph root

This commit is contained in:
Christoph Bumiller 2011-10-14 19:47:45 +02:00
parent d5cfab703b
commit e3a3844e8d

View file

@ -145,16 +145,16 @@ bool Graph::Node::detach(Graph::Node *node)
// Cut a node from the graph, deleting all attached edges.
void Graph::Node::cut()
{
if (!graph || (!in && !out))
return;
while (out)
delete out;
while (in)
delete in;
if (graph->root == this)
graph->root = NULL;
if (graph) {
if (graph->root == this)
graph->root = NULL;
graph = NULL;
}
}
Graph::Edge::Edge(Node *org, Node *tgt, Type kind)