]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Add a comment about why we don't delete the owner
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 14:32:07 +0000 (16:32 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 14:32:07 +0000 (16:32 +0200)
ast.c

diff --git a/ast.c b/ast.c
index 707e2286235342e8860d3b6c6abc8396cd1eeb86..6ba79dbb11e5ad4087934896b2528587c4b0307d 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -405,7 +405,14 @@ ast_member* ast_member_new(lex_ctx ctx, ast_expression *owner, unsigned int fiel
 
 void ast_member_delete(ast_member *self)
 {
-    /* ast_unref(self->owner); */
+    /* The owner is always an ast_value, which has .keep=true,
+     * also: ast_members are usually deleted after the owner, thus
+     * this will cause invalid access
+    ast_unref(self->owner);
+     * once we allow (expression).x to access a vector-member, we need
+     * to change this: preferably by creating an alternate ast node for this
+     * purpose that is not garbage-collected.
+    */
     ast_expression_delete((ast_expression*)self);
     mem_d(self);
 }