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
1 changed files with 3 additions and 2 deletions

View File

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