GC away some one-use initialization functions after they are run.

This commit is contained in:
Xinhuan
2009-08-08 17:36:33 +08:00
parent 5f8a470f48
commit 98d138a111
+8
View File
@@ -460,6 +460,8 @@ function Omen:CreateFrames()
else else
self.FocusButton:GetFontString():SetTextColor(0.5, 0.5, 0.5, 1) self.FocusButton:GetFontString():SetTextColor(0.5, 0.5, 0.5, 1)
end]] end]]
self.CreateFrames = nil
end end
function Omen:OnInitialize() function Omen:OnInitialize()
@@ -473,10 +475,12 @@ function Omen:OnInitialize()
LSM.RegisterCallback(self, "LibSharedMedia_Registered", "UpdateUsedMedia") LSM.RegisterCallback(self, "LibSharedMedia_Registered", "UpdateUsedMedia")
-- These 2 functions self GC after running
self:CreateFrames() self:CreateFrames()
self:SetupOptions() self:SetupOptions()
self:RegisterEvent("PLAYER_LOGIN") self:RegisterEvent("PLAYER_LOGIN")
self.OnInitialize = nil
end end
function Omen:PLAYER_LOGIN() function Omen:PLAYER_LOGIN()
@@ -575,6 +579,8 @@ function Omen:PLAYER_LOGIN()
self.optionsFrames["FuBar"] = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Omen", L["FuBar Options"], self.versionstring, "FuBar") self.optionsFrames["FuBar"] = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Omen", L["FuBar Options"], self.versionstring, "FuBar")
self:UpdateFuBarSettings() self:UpdateFuBarSettings()
end end
self.PLAYER_LOGIN = nil
end end
function Omen:OnEnable() function Omen:OnEnable()
@@ -1865,6 +1871,8 @@ function Omen:SetupOptions()
self:RegisterModuleOptions("OmenSlashCommand", self.OptionsSlash, L["Slash Command"]) self:RegisterModuleOptions("OmenSlashCommand", self.OptionsSlash, L["Slash Command"])
self:RegisterModuleOptions("Profiles", function() return LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db) end, L["Profiles"]) self:RegisterModuleOptions("Profiles", function() return LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db) end, L["Profiles"])
self.optionsFrames.Help = ACD3:AddToBlizOptions("Omen", L["Help File"], self.versionstring, "Help") self.optionsFrames.Help = ACD3:AddToBlizOptions("Omen", L["Help File"], self.versionstring, "Help")
self.SetupOptions = nil
end end
function Omen:RegisterModuleOptions(name, optionTbl, displayName) function Omen:RegisterModuleOptions(name, optionTbl, displayName)