glsl: Delete builtin_builder::shader when destroying built-ins.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 17 Sep 2013 06:35:41 +0000 (23:35 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 19 Sep 2013 17:52:58 +0000 (10:52 -0700)
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 <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/builtin_functions.cpp

index 31f7489d18f89c6c34b83933b9e7345631b35031..96358a7373d852370d73fee8ebcb678b5ee4312e 100644 (file)
@@ -580,6 +580,9 @@ builtin_builder::release()
 {
    ralloc_free(mem_ctx);
    mem_ctx = NULL;
+
+   ralloc_free(shader);
+   shader = NULL;
 }
 
 void