Lua: Object tables were left on stack, fixed.

This commit is contained in:
Birunthan Mohanathas 2012-03-10 07:03:19 +00:00
parent e2a736ed83
commit 13e5af0f17
4 changed files with 23 additions and 21 deletions

View File

@ -28,7 +28,7 @@ void LuaManager::Initialize()
if (c_State == NULL)
{
// Initialize Lua
c_State = lua_open();
c_State = luaL_newstate();
// Initialize standard libraries except debug, modified from linit.c
const luaL_Reg lualibs[] =
@ -53,7 +53,6 @@ void LuaManager::Initialize()
// Register custom types and functions
RegisterGlobal(c_State);
RegisterMeasure(c_State);
RegisterMeasure(c_State);
RegisterMeter(c_State);
RegisterMeterWindow(c_State);
}

View File

@ -167,4 +167,5 @@ void LuaManager::RegisterMeasure(lua_State* L)
luaL_register(L, "CMeasure", functions);
lua_pushvalue(L, -1);
lua_setfield(L, -2, "__index");
lua_pop(L, 1);
}

View File

@ -169,4 +169,5 @@ void LuaManager::RegisterMeter(lua_State* L)
luaL_register(L, "CMeter", functions);
lua_pushvalue(L, -1);
lua_setfield(L, -2, "__index");
lua_pop(L, 1);
}

View File

@ -200,4 +200,5 @@ void LuaManager::RegisterMeterWindow(lua_State* L)
luaL_register(L, "CMeterWindow", functions);
lua_pushvalue(L, -1);
lua_setfield(L, -2, "__index");
lua_pop(L, 1);
}