From 12c411504ca86341f8b96c349c15413ee198cc71 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Fri, 18 Jun 2010 17:52:59 -0700 Subject: Close memory leaks in glsl_type (constructor and get_array_instance) Add a talloc ctx to both get_array_instance and the glsl_type constructor in order to be able to call talloc_size instead of malloc. This fix now makes glsl-orangebook-ch06-bump.frag 99.99% leak free: total heap usage: 55,623 allocs, 55,615 Only 8 missing frees now. --- ast_function.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ast_function.cpp') diff --git a/ast_function.cpp b/ast_function.cpp index 9550d4d2f0..761af00b95 100644 --- a/ast_function.cpp +++ b/ast_function.cpp @@ -279,7 +279,8 @@ process_array_constructor(exec_list *instructions, if (constructor_type->length == 0) { constructor_type = - glsl_type::get_array_instance(constructor_type->element_type(), + glsl_type::get_array_instance(state, + constructor_type->element_type(), parameter_count); assert(constructor_type != NULL); assert(constructor_type->length == parameter_count); -- cgit v1.2.3