Are there any negative side effects to setting hooks this way?
#3
(10-23-2017, 05:15 PM)xoft Wrote: Yes, it is possible to register hooks that way, and your [...]

Thanks for the detailed descriptionTongue
I'm really fond of Cuberite, it's a wonderful project, and I can see that it has passionate devs.

I can see where the problem would arise. Would I be correct in assuming that setting hooks outside of any function, in the global scope, would always be safe from this problem only provided that an anonymous function is passed as the function argument? e.g.:

cPluginManager.AddHook(cPluginManager.HOOK_WHATEVER, function(...)
    --[[...]]
end)

Instead of:

cPluginManager.AddHook(cPluginManager.HOOK_WHATEVER, HookWhateverHandler)
Reply
Thanks given by:


Messages In This Thread
RE: Are there any negative side effects to setting hooks this way? - by dusk - 10-23-2017, 07:47 PM



Users browsing this thread: 1 Guest(s)