summaryrefslogtreecommitdiff
path: root/apps/plugins/lua
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua')
-rw-r--r--apps/plugins/lua/loslib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/plugins/lua/loslib.c b/apps/plugins/lua/loslib.c
index 6cb8c05..dce8811 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 */
}