diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-10-21 11:48:31 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-10-21 11:48:31 -0200 |
commit | 7f376e6ea88e218ba74137efaa5f84b837d8e277 (patch) | |
tree | 43dbe687a97af205e69d0bef9b931ffba55a4b8f | |
parent | 053e87314596e48588a929791012def7818ec989 (diff) | |
download | lua-7f376e6ea88e218ba74137efaa5f84b837d8e277.tar.gz lua-7f376e6ea88e218ba74137efaa5f84b837d8e277.tar.bz2 lua-7f376e6ea88e218ba74137efaa5f84b837d8e277.zip |
do a complete garbage collection in case of errors
-rw-r--r-- | lua.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.151 2005/10/14 18:15:46 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.152 2005/10/14 18:34:23 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -100,6 +100,8 @@ static int docall (lua_State *L, int narg, int clear) { | |||
100 | status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); | 100 | status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); |
101 | signal(SIGINT, SIG_DFL); | 101 | signal(SIGINT, SIG_DFL); |
102 | lua_remove(L, base); /* remove traceback function */ | 102 | lua_remove(L, base); /* remove traceback function */ |
103 | /* force a complete garbage collection in case of errors */ | ||
104 | if (status != 0) lua_gc(L, LUA_GCCOLLECT, 0); | ||
103 | return status; | 105 | return status; |
104 | } | 106 | } |
105 | 107 | ||