diff options
author | Mattes D <github@xoft.cz> | 2017-06-26 08:56:55 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2017-06-26 10:52:59 +0200 |
commit | e05ca494593d780c0ecf358bf66a94b224b35b5b (patch) | |
tree | c94b004d4c89aa118f889a2ae988cd354f69ace1 /src/Bindings/ManualBindings.cpp | |
parent | Fixed memory leak in cClientHandle. (#3794) (diff) | |
download | cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar.gz cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar.bz2 cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar.lz cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar.xz cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar.zst cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/ManualBindings.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 2c2de6296..565c636e3 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -132,46 +132,6 @@ int cManualBindings::lua_do_error(lua_State * L, const char * a_pFormat, ...) -int cManualBindings::ApiParamError(lua_State * a_LuaState, const char * a_MsgFormat, ...) -{ - // Retrieve current function name - lua_Debug entry; - VERIFY(lua_getstack(a_LuaState, 0, &entry)); - VERIFY(lua_getinfo(a_LuaState, "n", &entry)); - - // Compose the error message: - va_list argp; - va_start(argp, a_MsgFormat); - AString msg; - - #ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wformat-nonliteral" - #endif - - AppendVPrintf(msg, a_MsgFormat, argp); - - #ifdef __clang__ - #pragma clang diagnostic pop - #endif - - va_end(argp); - AString errorMsg = Printf("%s: %s", (entry.name != nullptr) ? entry.name : "<unknown function>", msg.c_str()); - - // Log everything into the console: - LOGWARNING("%s", errorMsg.c_str()); - // cLuaState::LogStackTrace(a_LuaState); // Do NOT log stack trace, it is already output as part of the Lua error handling - cLuaState::LogStackValues(a_LuaState, "Parameters on the stack"); - - // Raise Lua error: - lua_pushstring(a_LuaState, errorMsg.c_str()); - return lua_error(a_LuaState); -} - - - - - // Lua bound functions with special return types static int tolua_Clamp(lua_State * tolua_S) { |