The d_errFuncIndex variable is not initialized which causes the callback functors to believe they have an error handler set on debug builds when the CRT initializes the heap with 0xCDCDCDCD. You end up with a cryptic "error in error handler" message in the case where the lua script fails.
Current:
Code: Select all
LuaScriptModule::LuaScriptModule(lua_State* state)
{
// just use the given state
d_ownsState = false;
d_state = state;
setModuleIdentifierString();
}
Fix:
Code: Select all
LuaScriptModule::LuaScriptModule(lua_State* state) :
d_errFuncIndex(LUA_NOREF),
d_activeErrFuncIndex(LUA_NOREF)
{
// just use the given state
d_ownsState = false;
d_state = state;
setModuleIdentifierString();
}