diff options
Diffstat (limited to 'src/script/cpp_api/s_async.cpp')
-rw-r--r-- | src/script/cpp_api/s_async.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/script/cpp_api/s_async.cpp b/src/script/cpp_api/s_async.cpp index eb1a2923a..0e2a006ca 100644 --- a/src/script/cpp_api/s_async.cpp +++ b/src/script/cpp_api/s_async.cpp @@ -164,9 +164,7 @@ void AsyncEngine::step(lua_State *L, int errorhandler) lua_pushlstring(L, jobDone.serializedResult.data(), jobDone.serializedResult.size()); - if (lua_pcall(L, 2, 0, errorhandler)) { - script_error(L); - } + PCALL_RESL(L, lua_pcall(L, 2, 0, errorhandler)); } resultQueueMutex.Unlock(); lua_pop(L, 1); // Pop core @@ -293,8 +291,9 @@ void* AsyncWorkerThread::Thread() toProcess.serializedParams.data(), toProcess.serializedParams.size()); - if (lua_pcall(L, 2, 1, m_errorhandler)) { - scriptError(); + int result = lua_pcall(L, 2, 1, m_errorhandler); + if (result) { + PCALL_RES(result); toProcess.serializedResult = ""; } else { // Fetch result |