Remove threaded-ness of Auto 4 Lua macro validation calls, updates #927.

Originally committed to SVN as r3194.
This commit is contained in:
Niels Martin Hansen 2009-07-22 23:07:46 +00:00
parent 520239fc1b
commit 5e902e2ef1
1 changed files with 10 additions and 6 deletions

View File

@ -574,13 +574,17 @@ namespace Automation4 {
lua_pushinteger(L, -1); // active line
// do call
LuaThreadedCall call(L, 3, 1);
wxThread::ExitCode code = call.Wait();
(void) code;
// get result
bool result = !!lua_toboolean(L, -1);
int err = lua_pcall(L, 3, 1, 0);
bool result;
if (err) {
wxString errmsg(lua_tostring(L, -1), wxConvUTF8);
wxLogWarning(_T("Runtime error in Lua macro validation function:\n%s"), errmsg.c_str());
result = false;
} else {
result = !!lua_toboolean(L, -1);
}
// clean up stack
// clean up stack (result or error message)
lua_pop(L, 1);
return result;