Correctly pop stuff from the Lua stack in script_load()
authorPerttu Ahola <celeron55@gmail.com>
Sat, 31 Dec 2011 12:41:57 +0000 (14:41 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 31 Dec 2011 12:41:57 +0000 (14:41 +0200)
src/script.cpp

index 14c23e009f7728b380a4fa838281d627018f3f50..f91b228960c27ef17420cb1f7c737392fc9e892b 100644 (file)
@@ -101,8 +101,10 @@ bool script_load(lua_State *L, const char *path)
                errorstream<<"[LUA] "<<lua_tostring(L, -1)<<std::endl;
                errorstream<<"[LUA] "<<std::endl;
                lua_pop(L, 1); // Pop error message from stack
+               lua_pop(L, 1); // Pop the error handler from stack
                return false;
        }
+       lua_pop(L, 1); // Pop the error handler from stack
        return true;
 }