From: Eric Anholt Date: Mon, 8 Nov 2010 22:38:18 +0000 (-0800) Subject: glsl: Free the loop state context when we free the loop state. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6929cdd14bf90d5b145039265f2d43ded52020a3;p=mesa.git glsl: Free the loop state context when we free the loop state. Since this was talloced off of NULL instead of the compile state, it was a real leak over the course of the program. Noticed with valgrind --leak-check=full --show-reachable=yes. We should really change these passes to generally get the compile context as an argument so simple mistakes like this stop mattering. --- diff --git a/src/glsl/loop_analysis.cpp b/src/glsl/loop_analysis.cpp index 91e34da0ee4..ff7adf00a21 100644 --- a/src/glsl/loop_analysis.cpp +++ b/src/glsl/loop_analysis.cpp @@ -44,6 +44,7 @@ loop_state::loop_state() loop_state::~loop_state() { hash_table_dtor(this->ht); + talloc_free(this->mem_ctx); }