summaryrefslogtreecommitdiff
path: root/MLKInterpreter.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-03 13:46:59 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-03 13:46:59 +0200
commit804925fe07251561cfd53e93bece7f3ed259e9cb (patch)
treea26eb6839e7a5363a85bb28b5072196231d87d24 /MLKInterpreter.m
parent02ebdffc544f9ff20798cce31b26c4227c858123 (diff)
LOAD: Create an autorelease pool for each top-level form loaded.
Diffstat (limited to 'MLKInterpreter.m')
-rw-r--r--MLKInterpreter.m17
1 files changed, 12 insertions, 5 deletions
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