View Single Post
06/26/18, 04:46 PM   #8
Solinur
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 78
Originally Posted by SDPhantom View Post
On an added note, if you use EVENT_MANAGER:RegisterForUpdate() and don't unregister the function, it'll just keep calling at the interval you gave it. This is something zo_callLater() simply can't do without calling it more times.
Using zo_callLater() in a way where it can call itself again can lead to problems (function calls get piled up).

EVENT_MANAGER:RegisterForUpdate() is nice in a way that as long as you use a fixed string as the first parameter it will still just run once at every intervall. A second registration attempt with the same name simply fails (it also returns false then).

So it's best to decide on a per case basis which one to use.
  Reply With Quote