ir_reader: Free memory for S-Expressions earlier.
There's no point in keeping it around once we've read the IR. Also, remove an unnecessary talloc_parent call.
This commit is contained in:

committed by
Eric Anholt

parent
85c978f38c
commit
78062273de
@@ -70,8 +70,7 @@ void
|
|||||||
_mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions,
|
_mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions,
|
||||||
const char *src)
|
const char *src)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
s_expression *expr = s_expression::read_expression(state, src);
|
||||||
s_expression *expr = s_expression::read_expression(ctx, src);
|
|
||||||
if (expr == NULL) {
|
if (expr == NULL) {
|
||||||
ir_read_error(state, NULL, "couldn't parse S-Expression.");
|
ir_read_error(state, NULL, "couldn't parse S-Expression.");
|
||||||
return;
|
return;
|
||||||
@@ -82,6 +81,7 @@ _mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
read_instructions(state, instructions, expr, NULL);
|
read_instructions(state, instructions, expr, NULL);
|
||||||
|
talloc_free(expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user