diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-11-13 21:25:52 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-11-13 21:25:52 -0800 |
commit | da76ec44f1211ad49ab0700bda647bfe523d5093 (patch) | |
tree | 3a4138231955bb13b6fcdc3cb366e3ef3ad62eb2 | |
parent | 88f4b1bb2bdafe1994f9f025cadb422e8c1e78f3 (diff) | |
download | teliva-da76ec44f1211ad49ab0700bda647bfe523d5093.tar.gz |
.
-rw-r--r-- | src/lcurseslib.c | 4 | ||||
-rw-r--r-- | src/lua.c | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lcurseslib.c b/src/lcurseslib.c index 4d3284c..e866e57 100644 --- a/src/lcurseslib.c +++ b/src/lcurseslib.c @@ -9,7 +9,7 @@ #include "lauxlib.h" #include "lualib.h" -static void cleanup (void) { +void cleanup_curses (void) { if (!isendwin()) { wclear(stdscr); wrefresh(stdscr); @@ -477,7 +477,7 @@ LUALIB_API int luaopen_curses (lua_State *L) { lua_pushvalue(L, -2); register_curses_constants(L); - atexit(cleanup); + atexit(cleanup_curses); return 1; } diff --git a/src/lua.c b/src/lua.c index 9690184..d7939bf 100644 --- a/src/lua.c +++ b/src/lua.c @@ -566,6 +566,7 @@ static int pmain (lua_State *L) { extern void draw_menu (lua_State *); +extern void cleanup_curses (void); int main (int argc, char **argv) { @@ -589,7 +590,7 @@ int main (int argc, char **argv) { status = lua_cpcall(L, &pmain, &s); report(L, status); lua_close(L); - endwin(); + cleanup_curses(); return (status || s.status) ? EXIT_FAILURE : EXIT_SUCCESS; } |