Clear the guidNameLookup table on zoning to recover some memory.

This commit is contained in:
Xinhuan
2008-12-08 08:29:07 +08:00
parent 1c16bdda99
commit 1be205d8de
+13 -6
View File
@@ -534,7 +534,7 @@ function Omen:OnEnable()
--self:RegisterEvent("RAID_ROSTER_UPDATE", "PARTY_MEMBERS_CHANGED") -- Is this needed?
self:RegisterEvent("PLAYER_UPDATE_RESTING", "UpdateVisible")
self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateVisible")
self:RegisterEvent("PLAYER_ENTERING_WORLD")
if db.ShowWith.HideWhenOOC then
self:RegisterEvent("PLAYER_REGEN_DISABLED", "UpdateVisible")
@@ -679,8 +679,6 @@ function Omen:_toggle(setting)
end
function Omen:UpdateVisible(event)
if event == "PLAYER_ENTERING_WORLD" then manualToggle = false end
local t = db.ShowWith
if not t.UseShowWith or manualToggle then return end
@@ -1191,10 +1189,13 @@ function Omen:UpdatePartyGUIDs()
if me then -- Because it sometimes is nil on zoning/logging in.
guidNameLookup[me] = UnitName("player")
_, guidClassLookup[me] = UnitClass("player")
else
timers.UpdatePartyGUIDs = self:ScheduleTimer("UpdatePartyGUIDs", 0.5)
end
if UnitExists("pet") then
guidClassLookup[UnitGUID("pet")] = "PET"
guidNameLookup[UnitGUID("pet")] = UnitName("pet")--.." ["..UnitName("player").."]"
local petGUID = UnitGUID("pet")
guidClassLookup[petGUID] = "PET"
guidNameLookup[petGUID] = UnitName("pet")--.." ["..UnitName("player").."]"
end
if inParty or inRaid then
@@ -1220,9 +1221,15 @@ function Omen:UpdatePartyGUIDs()
end
end
end
guidNameLookup["AGGRO"] = L["> Pull Aggro <"]
guidClassLookup["AGGRO"] = "AGGRO"
end
guidNameLookup["AGGRO"] = L["> Pull Aggro <"]
function Omen:PLAYER_ENTERING_WORLD()
manualToggle = false
wipe(guidNameLookup)
self:PARTY_MEMBERS_CHANGED()
end
-----------------------------------------------------------------------------