lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

So lua_close is the problem.  Just a quick change to loslib.c

static int os_exit (lua_State *L) {
  int t = luaL_optint(L, 1, EXIT_SUCCESS);
  /* exit(luaL_optint(L, 1, EXIT_SUCCESS)); */

So far it does the job but I'm not sure if there is any memory
leakage.  The manual says it will free all memory associated with the
state but does it include those locked in COM and OLE?  In comparison,
the php manual explicitly says that an exit() will free all memory and
object destructors will always be executed.  I tried to find out how
it was implemented from the php source.  But then I gave up.