From d2d90d66d81d5f147b03628e1913bf7f9d2a0563 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 16 Sep 2013 23:35:41 -0700 Subject: [PATCH] glsl: Delete builtin_builder::shader when destroying built-ins. I would use _mesa_delete_shader, but it's declared static, and we don't really need any of the stuff in it anyway. This fixes a memory leak caught by Valgrind. Signed-off-by: Kenneth Graunke Reviewed-by: Eric Anholt --- src/glsl/builtin_functions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp index 31f7489d18f..96358a7373d 100644 --- a/src/glsl/builtin_functions.cpp +++ b/src/glsl/builtin_functions.cpp @@ -580,6 +580,9 @@ builtin_builder::release() { ralloc_free(mem_ctx); mem_ctx = NULL; + + ralloc_free(shader); + shader = NULL; } void -- 2.30.2