View Single Post
04-12-19, 04:55 AM   #4
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
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
  Reply With Quote