Quantcast

Periodically garbage-collect auras in the state machine.

Johnny C. Lam [11-26-13 - 14:05]
Periodically garbage-collect auras in the state machine.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1216 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleAura.lua
diff --git a/OvaleAura.lua b/OvaleAura.lua
index f06ffcf..859a88f 100644
--- a/OvaleAura.lua
+++ b/OvaleAura.lua
@@ -511,6 +511,10 @@ end

 -- Reset the state to the current conditions.
 function OvaleAura:ResetState(state)
+	-- Periodically garbage-collect auras in the state machine.
+	if not Ovale.enCombat and state.serial % 1000 then
+		self:CleanState(state)
+	end
 	state.serial = state.serial + 1
 end