From ce594af5fae1124d0a51ffe2f98fb30698b46f76 Mon Sep 17 00:00:00 2001 From: Bluewhale1337 <295648290+Bluewhale1337@users.noreply.github.com> Date: Sat, 18 Jul 2026 10:36:54 +0200 Subject: [PATCH] fix: memory leak in UnitAura and bump version to 1.4.2 --- HealBot_Controller_Aura.lua | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/HealBot_Controller_Aura.lua b/HealBot_Controller_Aura.lua index b527d95..9ae5d5e 100644 --- a/HealBot_Controller_Aura.lua +++ b/HealBot_Controller_Aura.lua @@ -115,23 +115,27 @@ function HealBot_CheckBuffs(unit) end end +local HealBot_TrackedHoTs = { + ["Interface\\Icons\\Spell_Holy_Renew"] = true, + ["Interface\\Icons\\Spell_Nature_Rejuvenation"] = true, + ["Interface\\Icons\\Spell_Nature_ResistNature"] = true, + ["Interface\\Icons\\Spell_Holy_PowerWordShield"] = true, + ["Interface\\Icons\\Spell_Holy_SealOfProtection"] = true, + ["Interface\\Icons\\Spell_Holy_Excorcism"] = true, + ["Interface\\Icons\\btnholyscriptures"] = true, +} + function HealBot_OnEvent_UnitAura(this, unit) local DebuffType; if HealBot_Heals[unit] and unit ~= "target" then - HealBot_UnitIcons[unit] = {} + if not HealBot_UnitIcons[unit] then + HealBot_UnitIcons[unit] = {} + end + for j = 1, 5 do + HealBot_UnitIcons[unit][j] = nil + end local iconCount = 0 - - local HealBot_TrackedHoTs = { - ["Interface\\Icons\\Spell_Holy_Renew"] = true, - ["Interface\\Icons\\Spell_Nature_Rejuvenation"] = true, - ["Interface\\Icons\\Spell_Nature_ResistNature"] = true, - ["Interface\\Icons\\Spell_Holy_PowerWordShield"] = true, - ["Interface\\Icons\\Spell_Holy_SealOfProtection"] = true, - ["Interface\\Icons\\Spell_Holy_Excorcism"] = true, - ["Interface\\Icons\\btnholyscriptures"] = true, - } - local i = 1; while true do local debuff, tmp, debuff_type = UnitDebuff(unit, i, 1)