d3dcompiler: Fix freeing function.

This commit is contained in:
Matteo Bruni 2012-09-28 17:22:38 +02:00 committed by Alexandre Julliard
parent 896d1047f3
commit f10e0d4e9e
2 changed files with 2 additions and 6 deletions

View File

@ -2227,7 +2227,7 @@ static DWORD add_modifier(DWORD modifiers, DWORD mod, const struct YYLTYPE *loc)
struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD major, DWORD minor,
const char *entrypoint, char **messages)
{
struct hlsl_ir_function_decl *function;
struct hlsl_ir_function_decl *function, *next_function;
struct hlsl_scope *scope, *next_scope;
struct hlsl_type *hlsl_type, *next_type;
struct hlsl_ir_var *var, *next_var;
@ -2284,7 +2284,7 @@ struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD major, DWORD mino
d3dcompiler_free(hlsl_ctx.source_files);
TRACE("Freeing functions IR.\n");
LIST_FOR_EACH_ENTRY(function, &hlsl_ctx.functions, struct hlsl_ir_function_decl, node.entry)
LIST_FOR_EACH_ENTRY_SAFE(function, next_function, &hlsl_ctx.functions, struct hlsl_ir_function_decl, node.entry)
free_function(function);
TRACE("Freeing variables.\n");

View File

@ -2369,12 +2369,8 @@ void free_instr(struct hlsl_ir_node *node)
void free_function(struct hlsl_ir_function_decl *func)
{
struct hlsl_ir_var *param, *next_param;
d3dcompiler_free((void *)func->name);
d3dcompiler_free((void *)func->semantic);
LIST_FOR_EACH_ENTRY_SAFE(param, next_param, func->parameters, struct hlsl_ir_var, node.entry)
d3dcompiler_free(param);
d3dcompiler_free(func->parameters);
free_instr_list(func->body);
d3dcompiler_free(func);