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. --- MLKReadEvalPrintLoop.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'MLKReadEvalPrintLoop.m') diff --git a/MLKReadEvalPrintLoop.m b/MLKReadEvalPrintLoop.m index d50b10b..092c6bd 100644 --- a/MLKReadEvalPrintLoop.m +++ b/MLKReadEvalPrintLoop.m @@ -68,6 +68,7 @@ static const char *prompt (EditLine *e) { NSInputStream *input; MLKStream *stream; BOOL success; + NSAutoreleasePool *pool; editline = el_init (_argv[0], stdin, stdout, stderr); el_set (editline, EL_PROMPT, &prompt); @@ -76,7 +77,9 @@ static const char *prompt (EditLine *e) { commands = history_init(); history (commands, &event, H_SETSIZE, 1000); el_set (editline, EL_HIST, history, commands); - + + pool = [[NSAutoreleasePool alloc] init]; + printf ("Loading init.lisp.\n"); NS_DURING { @@ -96,6 +99,8 @@ static const char *prompt (EditLine *e) { } NS_ENDHANDLER; + RELEASE (pool); + printf ("Done.\n\n"); printf ("This is Toilet Lisp, version 0.0.1.\n"); @@ -116,7 +121,6 @@ static const char *prompt (EditLine *e) { if (line_length > 1) { - NSAutoreleasePool *pool; NSArray *results; id code; -- cgit v1.2.3