From: Christoph Bumiller Date: Fri, 14 Oct 2011 17:47:45 +0000 (+0200) Subject: nv50/ir: fix leak in removal of graph root X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e3a3844e8de7ff69606e16eab752152f70785de8;p=mesa.git nv50/ir: fix leak in removal of graph root --- 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)