void CMLuaScript::Unload() { if (status == Loaded) { lua_rawgeti(L, LUA_REGISTRYINDEX, unloadRef); if (lua_isfunction(L, -1)) luaM_pcall(L); lua_pushnil(L); lua_rawsetp(L, LUA_REGISTRYINDEX, this); status = None; } luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED"); lua_pushnil(L); lua_setfield(L, -2, moduleName); lua_pop(L, 1); KillModuleIcons(id); KillModuleSounds(id); KillModuleMenus(id); KillModuleHotkeys(id); KillObjectEventHooks(this); KillObjectServices(this); }
CSrmmProxyWindow::~CSrmmProxyWindow() { DeleteObject(m_hbmpPreview); KillObjectEventHooks(this); }