- Lua/XML Help
- - strange error
there is something I really don't understand well.
I got this error, and I have a gmTweaks addon, but I don't call PetFrame:Hide()
2x [ADDON_ACTION_BLOCKED] AddOn 'gmTweaks' tried to call the protected function 'PetFrame:Hide()'.
!BugGrabber\BugGrabber.lua:519: in function <!BugGrabber\BugGrabber.lua:519>
[C]: in function `Hide'
FrameXML\PetFrame.lua:81: in function `PetFrame_Update'
FrameXML\PlayerFrame.lua:368: in function <FrameXML\PlayerFrame.lua:366>
[C]: in function `PlayerFrame_SequenceFinished'
FrameXML\PlayerFrame.lua:350: in function `PlayerFrame_UpdateArt'
FrameXML\PlayerFrame.lua:274: in function `OnEvent'
FrameXML\UnitFrame.lua:933: in function <FrameXML\UnitFrame.lua:931>
The gmTweaks code can be found in gmUI or here:
||08-23-19 02:17 AM
Some days ago someone mentioned Globe in another thread.
That tool is really extremly cool to check for problems.
There are some potential problems in your code.
A global use of unitplate for example.
While options is local you create a global frame by naming it options. Such a common name is really dangerous I think.
local options = CreateFrame("Frame", "options", InterfaceOptionsFramePanelContainer)
Another code that might be a problem ... the first button1 is local but not at the time you use it as name.
local button1 = CreateFrame("button", button1, options, "UIPanelButtonTemplate")
I have correct the iussues you pointed out in this way:
local ADDON = ...
-- [ ... ]
local options = CreateFrame("Frame", ADDON .. "options", InterfaceOptionsFramePanelContainer)
-- [ ... ]
local button1 = CreateFrame("button", ADDON .. "button1", options, "UIPanelButtonTemplate")
-- [ ... ]
It should be ok now even if I don't think they can solve the iussue in the first post.
Btw thanks so much for your reply. It is really appreciated.
||08-23-19 03:05 AM
The problem with blocked addons is that it blames the current running addon.
Not the one that tainted the function.
Btw I mentioned only button1 but button2 has the same problem ;)
When you really want to find out what is causing the problem you can use the taintlog
But be prepared for quite a bit of data ;)
when I fix button1 I fixed also button2 and checked if there are similar situations :)
I really don't know about taintlog. I'll try to debug with it asap.
Thanks again Rilgamon.
Your tips are precious.
||08-23-19 09:22 AM
As Rilgamon mentioned, the taintlog blames the currently running addon, which is almost never accurate. The example below is extremely rough, and is intended to be as simple as possible to get the point across.
- Game UI doing its thing using a global frame, variable, whatever
- Addon1 taints the UI path because all addons cause taint –– they aren't secure like Blizzard's UI code
- Addon1 does something with the global mentioned in #1 that messes with the Blizzard UI but doesn't break it
- Taintlog notes the bad behaviour and begins tracking the cause, but it's too late –– Addon1 is finished doing bad things
- Addon2 runs code, any code, even unrelated to the global and because addons are tainted by default, the taintlog throws a fit
- You get the error message [ADDON_ACTION_BLOCKED] blaming Addon2 because that was the last code ran
Keep in mind that Lua is a single thread language. That means Lua processes one command and then a second, then a third from a queue. It is not multi-threaded and cannot process two or more commands at the same time, which is another factor why the second addon gets the blame, even for something it had nothing to do with.
What you can do: turn on deeper taintlog tracking using /console taintLog setting
is a number between 0-2. The downside is that doing so will drastically slow down the game and drop frames while the game crunches through all that data.
|All times are GMT -6. The time now is 07:58 PM.
vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI