Skip to content

Commit

Permalink
fix memory hog
Browse files Browse the repository at this point in the history
  • Loading branch information
napnapnapnap committed Jun 11, 2021
1 parent b387bad commit 969ff55
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions BLT/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ local classColors = {
["WARLOCK"] = "9482C9",
["WARRIOR"] = "C79C6E"
}
local updateCooldownTimer = 0

-- Helper functions --
function BLT:Unit(name)
Expand Down Expand Up @@ -382,11 +383,17 @@ end
-- Core functions --
local f = CreateFrame("Frame")
f:SetScript("OnUpdate", function(_, elapsed)

if not mainFrame then return end
-- Update the Backend
BLT:UpdateBackend(elapsed)
-- Update the UI
BLT:UpdateUI()

updateCooldownTimer = updateCooldownTimer - elapsed
if updateCooldownTimer < -0.01 then
-- Update the Backend
BLT:UpdateBackend(elapsed)
-- Update the UI
BLT:UpdateUI()
updateCooldownTimer = 0.1
end
end)

local function HandleEvent(_, event, ...)
Expand Down

0 comments on commit 969ff55

Please sign in to comment.