summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-10-14 19:47:45 +0200
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-10-21 23:00:38 +0200
commite3a3844e8de7ff69606e16eab752152f70785de8 (patch)
tree4f406618bbb760f5f73ee12afea9a3b90cd4feb2
parentd5cfab703b1179ac6e81c6281f6e25d1cab9d4c2 (diff)
nv50/ir: fix leak in removal of graph root
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp
index e987706e415..2c64a140f51 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp
@@ -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)