summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)