Posted by aradel on Mon, 20 Apr 2015 01:41:58
Haven't touched LUA in awhile so I'm a bit rusty.
Basically I'm trying to add a chat filter along with slash commands, pretty straight forward. The problem is that when you want to remove the chat filter, it has no effect.
In my OnLoad function the appropriate call to ChatFrame_AddMessageEventFilter(...) is made. The filter is working. The removal of the filter is not. The weird thing is that it is working when you start the addon in an inactive state, manually register the event by using the slash command handler and then removing them in the same fashion.
Below pastebin is an example of when it isn't working (Although it should unless I misunderstood something).
if anyone can shed some light on this I'd appreciate it.
(I suspect LUA is handling the function pointer in the OnLoad function differently than expected (signature miss-match). Causing the call to RemoveMessageEventFilter fail when called during runtime. The thing is I don't get why. The filter function is clearly defined in the global scope as the first function in the LUA script file.)