1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-17 13:25:20 +03:00

[Companion] Horus simulator fixes

This commit is contained in:
Bertrand Songis 2016-12-02 19:56:31 +01:00
parent 9b3cd8eeff
commit c23ac292b7
4 changed files with 14 additions and 14 deletions

View file

@ -152,19 +152,19 @@ void luaDisable()
luaState = INTERPRETER_PANIC;
}
void luaClose(lua_State * L)
void luaClose(lua_State ** L)
{
if (L) {
if (*L) {
PROTECT_LUA() {
TRACE("luaClose %p", L);
lua_close(L); // this should not panic, but we make sure anyway
TRACE("luaClose %p", *L);
lua_close(*L); // this should not panic, but we make sure anyway
}
else {
// we can only disable Lua for the rest of the session
luaDisable();
}
UNPROTECT_LUA();
L = NULL;
*L = NULL;
}
}
@ -771,7 +771,7 @@ void luaInit()
{
TRACE("luaInit");
luaClose(lsScripts);
luaClose(&lsScripts);
if (luaState != INTERPRETER_PANIC) {
#if defined(USE_BIN_ALLOCATOR)

View file

@ -103,7 +103,7 @@ extern uint8_t luaScriptsCount;
extern ScriptInternalData standaloneScript;
extern ScriptInternalData scriptInternalData[MAX_SCRIPTS];
extern ScriptInputsOutputs scriptInputsOutputs[MAX_SCRIPTS];
void luaClose(lua_State * L);
void luaClose(lua_State ** L);
bool luaTask(event_t evt, uint8_t scriptType, bool allowLcdUsage);
void luaExec(const char * filename);
void luaError(lua_State * L, uint8_t error, bool acknowledge=true);