You can remove hooks if you use AceHook-3.0.
OnDisable is used if you want to create a "standby" mode for your addon. It isn't truly disabled, as the DisableAddOn API is not called. You would use the function to wipe variables, remove hooks, unregister events, etc, that you don't want to keep in memory or eating CPU cycles during "standby".
In your options table, you need to create an option to toggle enable/disable, calling OnEnable and OnDisable respectively.
If you leave out the toggle in your options, then your addon will fire OnInitialize and OnEnable as normal, but completely ignore OnDisable.
Last edited by myrroddin : 04-13-19 at 03:33 AM.
Reason: Adjust for unintended emoticon
|