diff options
Diffstat (limited to 'plugins/MirLua/src/mlua_script.cpp')
-rw-r--r-- | plugins/MirLua/src/mlua_script.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp index 9a0d840c0c..ce635a36cf 100644 --- a/plugins/MirLua/src/mlua_script.cpp +++ b/plugins/MirLua/src/mlua_script.cpp @@ -140,8 +140,7 @@ bool CMLuaScript::Load() if (lua_isfunction(L, -1))
{
lua_pushvalue(L, -1);
- lua_rawsetp(L, LUA_REGISTRYINDEX, this);
- //unloadRef = luaL_ref(L, LUA_REGISTRYINDEX);
+ unloadRef = luaL_ref(L, LUA_REGISTRYINDEX);
}
lua_pop(L, 1);
@@ -154,8 +153,7 @@ void CMLuaScript::Unload() {
if (status == Loaded)
{
- lua_rawgetp(L, LUA_REGISTRYINDEX, this);
- //lua_rawgeti(L, LUA_REGISTRYINDEX, unloadRef);
+ lua_rawgeti(L, LUA_REGISTRYINDEX, unloadRef);
if (lua_isfunction(L, -1))
luaM_pcall(L);
lua_pushnil(L);
@@ -168,9 +166,6 @@ void CMLuaScript::Unload() lua_setfield(L, -2, moduleName);
lua_pop(L, 1);
- //lua_pushnil(L);
- //lua_setglobal(L, moduleName);
-
KillModuleIcons(id);
KillModuleSounds(id);
KillModuleMenus(id);
|