From: Wolfgang Bumiller Date: Sat, 28 Apr 2012 15:29:43 +0000 (+0200) Subject: First delete the blocks, THEN the locals, since blocks USE locals, darn X-Git-Tag: 0.1-rc1~560 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=eef92df09223f5c3b0c824d8550bb03f5c47ff82;p=xonotic%2Fgmqcc.git First delete the blocks, THEN the locals, since blocks USE locals, darn --- diff --git a/ast.c b/ast.c index ae58b9d..c85c566 100644 --- a/ast.c +++ b/ast.c @@ -169,12 +169,12 @@ MEM_VEC_FUNCTIONS(ast_block, ast_expression*, exprs) void ast_block_delete(ast_block *self) { size_t i; - for (i = 0; i < self->locals_count; ++i) - ast_delete(self->locals[i]); - MEM_VECTOR_CLEAR(self, locals); for (i = 0; i < self->exprs_count; ++i) ast_unref(self->exprs[i]); MEM_VECTOR_CLEAR(self, exprs); + for (i = 0; i < self->locals_count; ++i) + ast_delete(self->locals[i]); + MEM_VECTOR_CLEAR(self, locals); mem_d(self); }