From e3a3844e8de7ff69606e16eab752152f70785de8 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Fri, 14 Oct 2011 19:47:45 +0200 Subject: [PATCH] nv50/ir: fix leak in removal of graph root --- src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp | 10 +++++----- 1 file 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) -- 2.30.2