From: Wolfgang (Blub) Bumiller Date: Sat, 18 Aug 2012 14:32:07 +0000 (+0200) Subject: Add a comment about why we don't delete the owner X-Git-Tag: 0.1-rc1~204 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ff1506983b5b343583791a9eeec4433f9e79392b;p=xonotic%2Fgmqcc.git Add a comment about why we don't delete the owner --- diff --git a/ast.c b/ast.c index 707e228..6ba79db 100644 --- 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); }