Purpose of Ace3's OnDisable() function?
Looking at other people's Ace3-based addons, it seems to be best practice to use the OnDisable() function to undo everything you did in OnEnable(); like hooking functions, registering events etc.
I have been doing the same for my addons but I never really understood why. Because whenever I disable my addon (i.e. untick it in the "AddOn List"), the OK button turns into "Reload UI". So I assume my OnDisable() function is never called at all? Why do I need it then?
Furthermore, when I use hooksecurefunc in my OnEnable(), there is not really any way of undoing this in OnDisable(), right?
|