From: Wolfgang (Blub) Bumiller Date: Sat, 18 Aug 2012 14:20:17 +0000 (+0200) Subject: delete ast_members from parser->locals when they were unused X-Git-Tag: 0.1-rc1~213 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cdeffb6de9b92b7c498380d802d3250ef9ba73aa;p=xonotic%2Fgmqcc.git delete ast_members from parser->locals when they were unused --- diff --git a/parser.c b/parser.c index 1ee5cad..2df00cd 100644 --- a/parser.c +++ b/parser.c @@ -1668,6 +1668,11 @@ static void parser_pop_local(parser_t *parser) { parser->locals_count--; mem_d(parser->locals[parser->locals_count].name); + if (!ast_usecount(parser->locals[parser->locals_count].var) && + ast_istype(parser->locals[parser->locals_count].var, ast_member)) + { + ast_delete(parser->locals[parser->locals_count].var); + } } static ast_block* parser_parse_block(parser_t *parser)