Fix crash when cancelling an automation script

This commit is contained in:
Thomas Goyne 2013-09-24 07:45:41 -07:00
parent 7651e83314
commit a28aafcdab

View file

@ -717,9 +717,10 @@ namespace Automation4 {
ps->Log("\n\nLua reported a runtime error:\n"); ps->Log("\n\nLua reported a runtime error:\n");
ps->Log(get_string_or_default(L, -1)); ps->Log(get_string_or_default(L, -1));
} }
lua_pop(L, 1); lua_pop(L, 2);
failed = true; failed = true;
} }
else
lua_remove(L, -nresults - 1); lua_remove(L, -nresults - 1);
lua_gc(L, LUA_GCCOLLECT, 0); lua_gc(L, LUA_GCCOLLECT, 0);