From 804925fe07251561cfd53e93bece7f3ed259e9cb Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 3 Aug 2008 13:46:59 +0200 Subject: LOAD: Create an autorelease pool for each top-level form loaded. --- MLKInterpreter.m | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'MLKInterpreter.m') diff --git a/MLKInterpreter.m b/MLKInterpreter.m index 48a4bc9..4341e55 100644 --- a/MLKInterpreter.m +++ b/MLKInterpreter.m @@ -1334,19 +1334,24 @@ static MLKSymbol *MULTIPLE_VALUE_CALL; id result; id expansion; //NSLog (@"; LOAD: Reding a form."); - id code = [MLKReader readFromStream:stream - eofError:NO - eofValue:eofValue - recursive:NO - preserveWhitespace:NO]; + id code; //NSLog (@"; LOAD: Reading finished."); NSString *formdesc; + NSAutoreleasePool *pool; //NSLog (@"%@", code); //NSLog (@"%@", [code descriptionForLisp]); //NSLog (@"%@", stream); //NSLog (@"..."); + pool = [[NSAutoreleasePool alloc] init]; + + code = [MLKReader readFromStream:stream + eofError:NO + eofValue:eofValue + recursive:NO + preserveWhitespace:NO]; + if (code == eofValue) break; @@ -1383,6 +1388,8 @@ static MLKSymbol *MULTIPLE_VALUE_CALL; expandOnly:NO]; //NSLog (@"; LOAD: Top-level form evaluated."); + RELEASE (pool); + if (print) { //FIXME -- cgit v1.2.3