From f2265c357bdd6339632f7e71e1010e901adc028c Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 22 Jun 2008 15:14:35 +0200 Subject: REPL: Create an autorelease pool in each iteration. --- MLKReadEvalPrintLoop.m | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'MLKReadEvalPrintLoop.m') diff --git a/MLKReadEvalPrintLoop.m b/MLKReadEvalPrintLoop.m index 1d79a2f..a32f066 100644 --- a/MLKReadEvalPrintLoop.m +++ b/MLKReadEvalPrintLoop.m @@ -22,7 +22,9 @@ #import "MLKPackage.h" #import "MLKReadEvalPrintLoop.h" #import "MLKReader.h" +#import "runtime-compatibility.h" +#import #import #import @@ -68,9 +70,12 @@ static const char *prompt (EditLine *e) { if (line_length > 0) { + NSAutoreleasePool *pool; NSString *result; id code; + pool = [[NSAutoreleasePool alloc] init]; + history (commands, &event, H_ENTER, line); code = [MLKReader readFromString:result]; result = [MLKInterpreter eval:code @@ -78,6 +83,8 @@ static const char *prompt (EditLine *e) { globalContext] withEnvironment:[MLKLexicalEnvironment globalEnvironment]]; + + RELEASE (pool); } //free (line); -- cgit v1.2.3