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

View file

@ -574,13 +574,17 @@ namespace Automation4 {
lua_pushinteger(L, -1); // active line lua_pushinteger(L, -1); // active line
// do call // do call
LuaThreadedCall call(L, 3, 1); int err = lua_pcall(L, 3, 1, 0);
wxThread::ExitCode code = call.Wait(); bool result;
(void) code; if (err) {
// get result wxString errmsg(lua_tostring(L, -1), wxConvUTF8);
bool result = !!lua_toboolean(L, -1); 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); lua_pop(L, 1);
return result; return result;