diff options
author | William Wilgus <me.theuser@yahoo.com> | 2019-07-13 07:46:32 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2019-07-13 07:46:32 -0500 |
commit | fc25562842e7e4fbfdbb879b9a400ddd9d6d5cf8 (patch) | |
tree | f76406c011146767ad30d0148df46d427c421637 /apps/plugins/lua | |
parent | 7739ad662271f3f3cdb7fe39ebc33666d2b4aec5 (diff) | |
download | rockbox-fc25562842e7e4fbfdbb879b9a400ddd9d6d5cf8.tar.gz rockbox-fc25562842e7e4fbfdbb879b9a400ddd9d6d5cf8.zip |
lua close state on os.exit
Change-Id: I376fad0f92f1155698740e1b8599a3385998575c
Diffstat (limited to 'apps/plugins/lua')
-rw-r--r-- | apps/plugins/lua/loslib.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) { | |||
172 | 172 | ||
173 | 173 | ||
174 | static int os_exit (lua_State *L) { | 174 | static int os_exit (lua_State *L) { |
175 | exit(luaL_optint(L, 1, EXIT_SUCCESS)); | 175 | int status = luaL_optint(L, 1, EXIT_SUCCESS); |
176 | lua_close(L); | ||
177 | exit(status); | ||
176 | return EXIT_SUCCESS; /* never reached, surpress warning */ | 178 | return EXIT_SUCCESS; /* never reached, surpress warning */ |
177 | } | 179 | } |
178 | 180 | ||