diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-03 13:46:59 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-03 13:46:59 +0200 |
commit | 804925fe07251561cfd53e93bece7f3ed259e9cb (patch) | |
tree | a26eb6839e7a5363a85bb28b5072196231d87d24 /MLKReadEvalPrintLoop.m | |
parent | 02ebdffc544f9ff20798cce31b26c4227c858123 (diff) |
LOAD: Create an autorelease pool for each top-level form loaded.
Diffstat (limited to 'MLKReadEvalPrintLoop.m')
-rw-r--r-- | MLKReadEvalPrintLoop.m | 8 |
1 files changed, 6 insertions, 2 deletions
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; |