View Bug Report
Superfluous RefreshPanel calls
Bug #: 974
File: LibAddonMenu-2.0
Date: 07/25/14 05:08 AM
By: merlight
Status: Fixed
Each panel with registerForRefresh = true causes registration of another "LAM-RefreshPanel" callback. There is no check-for-duplicates logic in CALLBACK_MANAGER, it's plain table.insert.

If N panels registerForRefresh, then whenever any of those panels is shown, or a control value changed, RefreshPanel is called N-times with the same argument (not all N panels are updated, only the one that was shown, or its value changed, is updated N times).

I think you can safely cm:RegisterCallback right after the definition of RefreshPanel, no need to defer that to onLoaded or later.

RSS 2.0 Feed for Bug CommentsNotes Sort Options
By: merlight - 07/25/14 11:19 AM
Update: scratch the last paragraph, early-loaded older LAM would cause multiple registered callbacks. Defer until the first panel with registerForRefresh is created.
By: Seerah - 07/25/14 12:10 PM
Oooh, good catch and good to know.