Fix: memory leak connected to lua 5.0 vaarargs

This commit is contained in:
Bluewhale1337
2026-07-26 15:47:37 +02:00
parent 1a100c4f0a
commit 1eb39c9969
19 changed files with 40 additions and 38 deletions
@@ -59,7 +59,7 @@ local function Update(self, event)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: AssistantIndicator.Override(self, event, ...) --[[ Override: AssistantIndicator.Override(self, event, ...)
Used to completely override the element's update process. Used to completely override the element's update process.
@@ -67,7 +67,7 @@ local function Path(self, ...)
* event - the event triggering the update (string) * event - the event triggering the update (string)
* ... - the arguments accompanying the event (string) * ... - the arguments accompanying the event (string)
--]] --]]
return (self.AssistantIndicator.Override or Update) (self, unpack(arg)) return (self.AssistantIndicator.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
+3 -3
View File
@@ -368,9 +368,9 @@ local function onUpdate(self, elapsed)
end end
end end
local function Update(self, ...) local function Update(self, event, a, b, c, d, e)
SPELLCAST_START(self, unpack(arg)) SPELLCAST_START(self, event, a, b, c, d, e)
return SPELLCAST_CHANNEL_START(self, unpack(arg)) return SPELLCAST_CHANNEL_START(self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
@@ -57,14 +57,14 @@ local function Update(self, event)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: CombatIndicator.Override(self, event) --[[ Override: CombatIndicator.Override(self, event)
Used to completely override the internal update function. Used to completely override the internal update function.
* self - the parent object * self - the parent object
* event - the event triggering the update (string) * event - the event triggering the update (string)
--]] --]]
return (self.CombatIndicator.Override or Update) (self, unpack(arg)) return (self.CombatIndicator.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
+2 -2
View File
@@ -67,7 +67,7 @@ local function Update(self, event)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: ComboPoints.Override(self, event, ...) --[[ Override: ComboPoints.Override(self, event, ...)
Used to completely override the internal update function. Used to completely override the internal update function.
@@ -75,7 +75,7 @@ local function Path(self, ...)
* event - the event triggering the update (string) * event - the event triggering the update (string)
* ... - the arguments accompanying the event * ... - the arguments accompanying the event
--]] --]]
return (self.ComboPoints.Override or Update) (self, unpack(arg)) return (self.ComboPoints.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
@@ -73,7 +73,7 @@ local function Update(self, event, unit)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: HappinessIndicator.Override(self, event, ...) --[[ Override: HappinessIndicator.Override(self, event, ...)
Used to completely override the internal update function. Used to completely override the internal update function.
@@ -81,7 +81,7 @@ local function Path(self, ...)
* event - the event triggering the update (string) * event - the event triggering the update (string)
* ... - the arguments accompanying the event * ... - the arguments accompanying the event
--]] --]]
return (self.HappinessIndicator.Override or Update) (self, unpack(arg)) return (self.HappinessIndicator.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
+2 -2
View File
@@ -187,7 +187,7 @@ local function Update(self, event, unit)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: Health.Override(self, event, unit) --[[ Override: Health.Override(self, event, unit)
Used to completely override the internal update function. Used to completely override the internal update function.
@@ -195,7 +195,7 @@ local function Path(self, ...)
* event - the event triggering the update (string) * event - the event triggering the update (string)
* unit - the unit accompanying the event (string) * unit - the unit accompanying the event (string)
--]] --]]
return (self.Health.Override or Update) (self, unpack(arg)) return (self.Health.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
@@ -60,7 +60,7 @@ local function Update(self, event)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: LeaderIndicator.Override(self, event, ...) --[[ Override: LeaderIndicator.Override(self, event, ...)
Used to completely override the internal update function. Used to completely override the internal update function.
@@ -68,7 +68,7 @@ local function Path(self, ...)
* event - the event triggering the update (string) * event - the event triggering the update (string)
* ... - the arguments accompanying the event * ... - the arguments accompanying the event
--]] --]]
return (self.LeaderIndicator.Override or Update) (self, unpack(arg)) return (self.LeaderIndicator.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
@@ -81,7 +81,7 @@ local function Update(self, event)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: MasterLooterIndicator.Override(self, event, ...) --[[ Override: MasterLooterIndicator.Override(self, event, ...)
Used to completely override the internal update function. Used to completely override the internal update function.
@@ -89,7 +89,7 @@ local function Path(self, ...)
* event - the event triggering the update (string) * event - the event triggering the update (string)
* ... - the arguments accompanying the event * ... - the arguments accompanying the event
--]] --]]
return (self.MasterLooterIndicator.Override or Update) (self, unpack(arg)) return (self.MasterLooterIndicator.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
+2 -2
View File
@@ -91,7 +91,7 @@ local function Update(self, event, unit)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: Portrait.Override(self, event, unit) --[[ Override: Portrait.Override(self, event, unit)
Used to completely override the internal update function. Used to completely override the internal update function.
@@ -99,7 +99,7 @@ local function Path(self, ...)
* event - the event triggering the update (string) * event - the event triggering the update (string)
* unit - the unit accompanying the event (string) * unit - the unit accompanying the event (string)
--]] --]]
return (self.Portrait.Override or Update) (self, unpack(arg)) return (self.Portrait.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
+2 -2
View File
@@ -202,7 +202,7 @@ local function Update(self, event, unit)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: Power.Override(self, event, unit, ...) --[[ Override: Power.Override(self, event, unit, ...)
Used to completely override the internal update function. Used to completely override the internal update function.
@@ -211,7 +211,7 @@ local function Path(self, ...)
* unit - the unit accompanying the event (string) * unit - the unit accompanying the event (string)
* ... - the arguments accompanying the event * ... - the arguments accompanying the event
--]] --]]
return (self.Power.Override or Update) (self, unpack(arg)) return (self.Power.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
@@ -79,7 +79,7 @@ local function Update(self, event, unit)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[Override: PvPIndicator.Override(self, event, ...) --[[Override: PvPIndicator.Override(self, event, ...)
Used to completely override the internal update function. Used to completely override the internal update function.
@@ -87,7 +87,7 @@ local function Path(self, ...)
* event - the event triggering the update (string) * event - the event triggering the update (string)
* ... - the arguments accompanying the event * ... - the arguments accompanying the event
--]] --]]
return (self.PvPIndicator.Override or Update) (self, unpack(arg)) return (self.PvPIndicator.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
@@ -59,14 +59,14 @@ local function Update(self, event)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: RaidTargetIndicator.Override(self, event) --[[ Override: RaidTargetIndicator.Override(self, event)
Used to completely override the internal update function. Used to completely override the internal update function.
* self - the parent object * self - the parent object
* event - the event triggering the update (string) * event - the event triggering the update (string)
--]] --]]
return (self.RaidTargetIndicator.Override or Update) (self, unpack(arg)) return (self.RaidTargetIndicator.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
+2 -2
View File
@@ -73,14 +73,14 @@ local function Update(self, event)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: Range.Override(self, event) --[[ Override: Range.Override(self, event)
Used to completely override the internal update function. Used to completely override the internal update function.
* self - the parent object * self - the parent object
* event - the event triggering the update (string) * event - the event triggering the update (string)
--]] --]]
return (self.Range.Override or Update) (self, unpack(arg)) return (self.Range.Override or Update) (self, event, a, b, c, d, e)
end end
-- Internal updating method -- Internal updating method
@@ -57,14 +57,14 @@ local function Update(self, event)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: RestingIndicator.Override(self, event) --[[ Override: RestingIndicator.Override(self, event)
Used to completely override the internal update function. Used to completely override the internal update function.
* self - the parent object * self - the parent object
* event - the event triggering the update (string) * event - the event triggering the update (string)
--]] --]]
return (self.RestingIndicator.Override or Update) (self, unpack(arg)) return (self.RestingIndicator.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
+2 -2
View File
@@ -22,9 +22,9 @@ local function onEvent()
end end
local event_metatable = { local event_metatable = {
__call = function(funcs, self, ...) __call = function(funcs, self, event, a, b, c, d, e)
for _, func in next, funcs do for _, func in next, funcs do
func(self, unpack(arg)) func(self, event, a, b, c, d, e)
end end
end, end,
} }
@@ -443,7 +443,7 @@ function lib:AddListener(tab, method)
error(format("Bad argument #3 to `AddListener'. Expected method, got %q.", type(tab[method])), 2) error(format("Bad argument #3 to `AddListener'. Expected method, got %q.", type(tab[method])), 2)
end end
func = function(...) func = function(...)
return tab[method](tab, unpack(arg)) return tab[method](tab, event, a, b, c, d, e)
end end
elseif type(tab) == "function" then elseif type(tab) == "function" then
func = tab func = tab
@@ -53,8 +53,8 @@ local function Update(self, event, unit, currMana, maxMana)
end end
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
return (self.DruidAltMana.Override or Update) (self, unpack(arg)) return (self.DruidAltMana.Override or Update) (self, event, a, b, c, d, e)
end end
local function ElementEnable(self) local function ElementEnable(self)
@@ -101,8 +101,8 @@ local function Visibility(self, event, unit)
end end
end end
local function VisibilityPath(self, ...) local function VisibilityPath(self, event, a, b, c, d, e)
return (self.DruidAltMana.OverrideVisibility or Visibility) (self, unpack(arg)) return (self.DruidAltMana.OverrideVisibility or Visibility) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
@@ -221,7 +221,7 @@ local function Update(self, event, unit)
} }
end end
local function Path(self, ...) local function Path(self, event, a, b, c, d, e)
--[[ Override: RaidDebuffs.Override(self, event, ...) --[[ Override: RaidDebuffs.Override(self, event, ...)
Used to completely override the element's update process. Used to completely override the element's update process.
@@ -229,7 +229,7 @@ local function Path(self, ...)
* event - the event triggering the update (string) * event - the event triggering the update (string)
* ... - the arguments accompanying the event (string) * ... - the arguments accompanying the event (string)
--]] --]]
return (self.RaidDebuffs.Override or Update) (self, unpack(arg)) return (self.RaidDebuffs.Override or Update) (self, event, a, b, c, d, e)
end end
local function ForceUpdate(element) local function ForceUpdate(element)
+2
View File
@@ -6,6 +6,8 @@
# This repository is actively being fixed and maintained by Bluewhale. # This repository is actively being fixed and maintained by Bluewhale.
## Changelog ## Changelog
- **Fix:** Fixed nil ID formatting crash in Tooltip's SetHyperlink.
- **Fix:** Removed implicit `arg` table memory leaks in high-frequency oUF element updates by replacing varargs (`...`) with static parameters.
- **Fix:** Corrected bug in `Auras.lua` where unused buff icons remained visible on screen due to improper `deadIndex` calculation. - **Fix:** Corrected bug in `Auras.lua` where unused buff icons remained visible on screen due to improper `deadIndex` calculation.
- **Fix:** Fixed quest tracker duplicating entries by overriding `QuestWatch_Update` to deduplicate quests manually. - **Fix:** Fixed quest tracker duplicating entries by overriding `QuestWatch_Update` to deduplicate quests manually.
- **Fix:** Hid the unwanted `MoneyInputFrame` from appearing over `StaticPopup` dialogs (like the UI Reload prompt) by updating custom popup handling. - **Fix:** Hid the unwanted `MoneyInputFrame` from appearing over `StaticPopup` dialogs (like the UI Reload prompt) by updating custom popup handling.