Mesa (master): glsl: Free the loop state context when we free the loop state.

Eric Anholt anholt at kemper.freedesktop.org
Thu Nov 11 15:16:33 PST 2010


Module: Mesa
Branch: master
Commit: 6929cdd14bf90d5b145039265f2d43ded52020a3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6929cdd14bf90d5b145039265f2d43ded52020a3

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Nov  8 14:38:18 2010 -0800

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.

---

 src/glsl/loop_analysis.cpp |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/glsl/loop_analysis.cpp b/src/glsl/loop_analysis.cpp
index 91e34da..ff7adf0 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);
 }
 
 



More information about the mesa-commit mailing list