guard compilation exception and release the compiler

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@16262 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Stefan Urbanek 2003-03-25 18:31:18 +00:00
parent 12853b27e7
commit f4fb09ddd5
3 changed files with 12 additions and 3 deletions

View file

@ -3,6 +3,7 @@
* STSourceReader: added missing [super dealloc]
* STCompiledCode: do not retain bytecode data
* STCompiler: various memory leak fixes
* SmalltalkEngine: guard compilation exception and release the compiler
2003 Mar 23

View file

@ -157,6 +157,8 @@ extern int STCparse(void *context);
if ([[localException name] isEqualToString: STCompilerSyntaxException])
{
RELEASE(reader);
RELEASE(receiverVars);
receiverVars = nil;
reader = nil;
[NSException raise:STCompilerSyntaxException

View file

@ -70,9 +70,15 @@
[compiler setEnvironment:env];
script = [compiler compileString:sourceCode];
retval = [script executeInEnvironment:env];
NS_DURING
script = [compiler compileString:sourceCode];
retval = [script executeInEnvironment:env];
NS_HANDLER
RELEASE(compiler);
compiler = nil;
[localException raise];
NS_ENDHANDLER
RELEASE(compiler);
return retval;