summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-18 00:51:27 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-18 01:21:44 +0200
commite7212b465a8d40ae4e5bff112887e3e8c210019f (patch)
tree9113d5650e199be6e2defbef6a3d5990563fb91b
parentd86ccf58d5b462100d1f4ec5d016024543ec7f53 (diff)
MLKForm class cluster: Fix various memory management errors.
-rw-r--r--MLKForm.m37
1 files changed, 19 insertions, 18 deletions
diff --git a/MLKForm.m b/MLKForm.m
index b255cc9..d8f72bc 100644
--- a/MLKForm.m
+++ b/MLKForm.m
@@ -43,9 +43,10 @@
inContext:(MLKLexicalContext *)context
forCompiler:(id)compiler
{
- _form = object;
- _context = context;
- _compiler = compiler;
+ self = [super init];
+ LASSIGN (_form, object);
+ LASSIGN (_context, context);
+ LASSIGN (_compiler, compiler);
return [self complete];
}
@@ -170,24 +171,24 @@
else if ([_head isKindOfClass:[MLKCons class]])
{
LRELEASE (self);
- return [MLKForm formWithObject:[MLKCons cons:FUNCALL
- with:object]
- inContext:context
- forCompiler:compiler];
+ return LRETAIN ([MLKForm formWithObject:[MLKCons cons:FUNCALL
+ with:object]
+ inContext:context
+ forCompiler:compiler]);
}
else if ([context symbolNamesMacro:_head])
{
LRELEASE (self);
- return [MLKMacroCallForm formWithObject:object
- inContext:context
- forCompiler:compiler];
+ return LRETAIN ([MLKMacroCallForm formWithObject:object
+ inContext:context
+ forCompiler:compiler]);
}
else
{
LRELEASE (self);
- return [MLKFunctionCallForm formWithObject:object
- inContext:context
- forCompiler:compiler];
+ return LRETAIN ([MLKFunctionCallForm formWithObject:object
+ inContext:context
+ forCompiler:compiler]);
}
}
@@ -215,9 +216,9 @@
_form, context, nil]]
objectAtIndex:0]);
- return [MLKForm formWithObject:expansion
- inContext:context
- forCompiler:compiler];
+ return LRETAIN ([MLKForm formWithObject:expansion
+ inContext:context
+ forCompiler:compiler]);
}
@end
@@ -225,7 +226,7 @@
@implementation MLKBodyForm
-(void) splitDeclarationsAndBody:(id)object
{
- _body = object;
+ LASSIGN (_body, object);
}
-(void) processBody:(id)object inContext:(MLKLexicalContext *)context
@@ -523,7 +524,7 @@
inContext:newContext
forCompiler:_compiler];
LRELEASE (self); //?FIXME
- return newForm;
+ return LRETAIN (newForm);
}
@end