From 5e902e2ef151a38a24252ac8579ef8446bf39c59 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Wed, 22 Jul 2009 23:07:46 +0000 Subject: [PATCH] Remove threaded-ness of Auto 4 Lua macro validation calls, updates #927. Originally committed to SVN as r3194. --- aegisub/src/auto4_lua.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aegisub/src/auto4_lua.cpp b/aegisub/src/auto4_lua.cpp index 67519aad1..2820c9568 100644 --- a/aegisub/src/auto4_lua.cpp +++ b/aegisub/src/auto4_lua.cpp @@ -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;