|
Warning - in my sample, i wrote:
you must copy the error message before popping the stack. last_error is a string object which performs the copy.if (status != 0) { last_error = lua_tostring(L, -1); lua_pop(L, 1); // remove error message }
ps the code is adapted from lauxlib's dofile. Adrian