]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
First delete the blocks, THEN the locals, since blocks USE locals, darn
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Sat, 28 Apr 2012 15:29:43 +0000 (17:29 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Sat, 28 Apr 2012 18:55:41 +0000 (20:55 +0200)
ast.c

diff --git a/ast.c b/ast.c
index ae58b9d2ca5d91c7adf2fb1baa48d67a9401cdac..c85c5662118dd3e650327c24ab1a19f6d5fb82f9 100644 (file)
--- 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);
 }