Fix certain Lua script errors hanging the GUI (#899)
* Fixed a bug where a standalone Lua script w/o a run function will hang the GUI on non-color radios * Prevent Lua standalone window from opening if Lua failed on load * Fixed scroll down key in TX12 simulator Copied key definitions from TX16S * Fixed the Lua error trying to call nil value when no scripts are loaded. * I messed up in the previous commit; now it does not freeze and it does not call nil.
This commit is contained in:
@@ -334,8 +334,8 @@ void RadioSdManagerPage::build(FormWindow * window)
|
||||
std::string fullpath = currentPath + "/" + name;
|
||||
menu->addLine(STR_EXECUTE_FILE, [=]() {
|
||||
luaExec(fullpath.c_str());
|
||||
//TODO: check 'luaState'
|
||||
StandaloneLuaWindow::instance()->attach(window);
|
||||
if (luaState != INTERPRETER_RELOAD_PERMANENT_SCRIPTS)
|
||||
StandaloneLuaWindow::instance()->attach(window);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -126,8 +126,10 @@ void RadioToolsPage::rebuild(FormWindow * window)
|
||||
*((char *)getBasename(toolPath)-1) = '\0';
|
||||
f_chdir(toolPath);
|
||||
|
||||
StandaloneLuaWindow::instance()->attach(window);
|
||||
luaExec(path_str.c_str());
|
||||
if (luaState != INTERPRETER_RELOAD_PERMANENT_SCRIPTS)
|
||||
StandaloneLuaWindow::instance()->attach(window);
|
||||
|
||||
return 0;
|
||||
},
|
||||
OPAQUE);
|
||||
|
||||
Reference in New Issue
Block a user