That is because you have altered the Blizzard frames in combat with your UpdateView?!
The state driver will do the show/hide for you securely.
Do not interact with the frames directly unless you have a InCombatLockdown check in place.
That being said you can write your own secure handler. Inside that handler you have access to a referenced frame if needed and have access to functions that are allowed in secure environment.
An example can be the secure page handling on actionbars I use:
https://github.com/zorker/rothui/blo...r/bars.lua#L78
Lua Code:
--state frame
local frame = CreateFrame("Frame",nil,nil,"SecureHandlerStateTemplate")
--_onstate-boss state driver
for id = 1, MAX_BOSS_FRAMES do
local name = "Boss"..i.."TargetFrame"
local unitFrame = _G[name]
frame:SetFrameRef(name, unitFrame)
end
frame:Execute(([[
unitFrames = table.new()
for i=1, %d do
table.insert(unitFrames , self:GetFrameRef("Boss"..i.."TargetFrame"))
end
]]):format(MAX_BOSS_FRAMES))
frame:SetAttribute("_onstate-boss", [[
print("_onstate-boss",newstate,unitFrames )
for i, unitFrame in next, unitFrames do
print(unitFrame:GetName(),unitFrame:IsShown())
end
]])
RegisterStateDriver(frame, "boss", "[@boss5,exists,nodead]5;[@boss4,exists,nodead]4;[@boss3,exists,nodead]3;[@boss2,exists,nodead]2;[@boss1,exists,nodead]1;0")