system/luaserver: Terminate Lua script when luaclient dies.

Origin commit data
------------------
Branch: ni/coolstream
Commit: ffec667030
Author: martii <m4rtii@gmx.de>
Date: 2014-10-13 (Mon, 13 Oct 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2014-10-13 22:11:25 +02:00
committed by vanhofen
parent 2ceadabeac
commit c2b0b10434
4 changed files with 55 additions and 17 deletions

View File

@@ -480,6 +480,16 @@ void CLuaInstance::runScript(const char *fileName, const char *arg0, ...)
args.clear();
}
static void abortHook(lua_State *lua, lua_Debug *)
{
luaL_error(lua, "aborted");
}
void CLuaInstance::abortScript()
{
lua_sethook(lua, &abortHook, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1);
}
const luaL_Reg CLuaInstance::methods[] =
{
{ "PaintBox", CLuaInstance::PaintBox },