- Fixed problem with memory clean up time out after combat.

- Fixed a window group problem where sometimes during logon it breaks the addon.
This commit is contained in:
tercio
2014-10-29 15:42:07 -02:00
parent b16c61bc1f
commit 4dd789e3f9
4 changed files with 28 additions and 11 deletions
+6 -9
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -604,7 +604,7 @@
end
function _detalhes:CheckMemoryAfterCombat()
if (_detalhes.next_memory_check < time()) then
if (_detalhes.next_memory_check < time() and not InCombatLockdown() and not UnitAffectingCombat ("player")) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) checking memory after combat.")
end
@@ -617,7 +617,7 @@
end
end
function _detalhes:CheckMemoryPeriodically()
if (_detalhes.next_memory_check <= time() and not _InCombatLockdown() and not _detalhes.in_combat) then
if (_detalhes.next_memory_check <= time() and not _InCombatLockdown() and not _detalhes.in_combat and not UnitAffectingCombat ("player")) then
_detalhes.next_memory_check = time() + _detalhes.intervalo_memoria - 3
UpdateAddOnMemoryUsage()
local memory = GetAddOnMemoryUsage ("Details")
+14
View File
@@ -454,6 +454,16 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy)
_detalhes.move_janela_func (instance.baseframe, false, instance)
end
end
else
--> is in startup
for _, instance in _detalhes:ListInstances() do
for side, id in pairs (instance.snap) do
local window = _detalhes.tabela_instancias [id]
if (not window.ativa) then
instance.snap [side] = nil
end
end
end
end
end
@@ -470,6 +480,10 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy)
--> update tooltip settings
_detalhes:SetTooltipBackdrop()
if (_detalhes.initializing) then
_detalhes.profile_loaded = true
end
--> end
return true
+6
View File
@@ -156,6 +156,10 @@ function _G._detalhes:Start()
self.RefreshAfterStartup = nil
function _detalhes:CheckWallpaperAfterStartup()
if (not _detalhes.profile_loaded) then
return _detalhes:ScheduleTimer ("CheckWallpaperAfterStartup", 2)
end
for i = 1, self.instances_amount do
local instance = self:GetInstance (i)
if (instance and instance:IsEnabled()) then
@@ -167,7 +171,9 @@ function _G._detalhes:Start()
end
end
self.CheckWallpaperAfterStartup = nil
_detalhes.profile_loaded = nil
end
_detalhes:ScheduleTimer ("CheckWallpaperAfterStartup", 5)
end