From fc25562842e7e4fbfdbb879b9a400ddd9d6d5cf8 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 13 Jul 2019 07:46:32 -0500 Subject: lua close state on os.exit Change-Id: I376fad0f92f1155698740e1b8599a3385998575c --- apps/plugins/lua/loslib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/plugins/lua/loslib.c b/apps/plugins/lua/loslib.c index 6cb8c0541b..dce8811fbe 100644 --- a/apps/plugins/lua/loslib.c +++ b/apps/plugins/lua/loslib.c @@ -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 */ } -- cgit v1.2.3