This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
A recent change in CallbackHandler added some internal stuff that breaks the way LibBars clears all registrations. The below patch reportedly fixes the issue:
Index: LibBars-1.0.lua===================================================================--- LibBars-1.0.lua (revision 17)+++ LibBars-1.0.lua (working copy)@@ -1059,21 +1059,15 @@ self.timerLabel:SetFont(f, s or 10, m)
-- Cancel all registered callbacks. CBH doesn't seem to provide a method to do this.- if self.callbacks.insertQueue then- for eventname, callbacks in pairs(self.callbacks.insertQueue) do- for k, v in pairs(callbacks) do- callbacks[k] = nil- end- end- end- for eventname, callbacks in pairs(self.callbacks.events) do- for k, v in pairs(callbacks) do- callbacks[k] = nil- end- if self.callbacks.OnUnused then- self.callbacks.OnUnused(self.callbacks, target, eventname)- end- end+ local listeners = {}+ for eventname, callbacks in pairs(self.callbacks.events) do+ for listener, callback in pairs(callbacks) do+ listeners[listener] = true+ end+ end+ for listener, _ in pairs(listeners) do+ self.UnregisterAllCallbacks(listener)+ end end
function barPrototype:GetGroup()
This patch is semi-broken in that it doesn't examine the insertQueue.
Either way, digging into the innards of CBH like this is something that (for now obvious reasons i hope) you should never do. I'm thinking adding an :UnregisterAll() on the registry object is the way to go.
Though, I must ask, why is this even needed? An operation like this causes clients to not receive any further callbacks at all, perhaps in a situation where they have internal state EXPECTING callbacks?
To post a comment, please login or register a new account.