lua close state on os.exit

Change-Id: I376fad0f92f1155698740e1b8599a3385998575c
This commit is contained in:
William Wilgus 2019-07-13 07:46:32 -05:00
parent 7739ad6622
commit fc25562842

View file

@ -172,7 +172,9 @@ static int os_time (lua_State *L) {
static int os_exit (lua_State *L) {
exit(luaL_optint(L, 1, EXIT_SUCCESS));
int status = luaL_optint(L, 1, EXIT_SUCCESS);
lua_close(L);
exit(status);
return EXIT_SUCCESS; /* never reached, surpress warning */
}