mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 09:51:13 +02:00
system/luaserver: Terminate Lua script when luaclient dies.
Origin commit data
------------------
Commit: ffec667030
Author: martii <m4rtii@gmx.de>
Date: 2014-10-13 (Mon, 13 Oct 2014)
This commit is contained in:
@@ -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 },
|
||||
|
Reference in New Issue
Block a user