diff options
Diffstat (limited to 'bruiser/bruiser.cpp')
-rw-r--r-- | bruiser/bruiser.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bruiser/bruiser.cpp b/bruiser/bruiser.cpp index 0ec8d7d..4549940 100644 --- a/bruiser/bruiser.cpp +++ b/bruiser/bruiser.cpp @@ -188,6 +188,15 @@ class LuaEngine lua_close(LS); } + void HandleLuaErrorGeneric(lua_State* LS, const char* fmt, ...) { + va_list argp; + va_start(argp, fmt); + std::vfprintf(stderr, fmt, argp); + va_end(argp); + lua_close(LS); + exit(EXIT_FAILURE); + } + private: lua_State* LS; }; @@ -1644,8 +1653,7 @@ int main(int argc, const char **argv) LE.RunChunk((char*)line.c_str()); } - LE.Cleanup(); - + dostring(LE.GetLuaState(), "os.exit()", "test"); return 0; } @@ -1672,6 +1680,8 @@ int main(int argc, const char **argv) linenoiseFree(command); } + LE.Cleanup(); + /*end of bruiser main*/ return 0; } //end of cli block |