In most cases, one only wants a single copy of a hook. On the other hand, plugins that depend on other plugins, may want to make it easier for the end-user to use the plugin, and call the setup function of the dependent plugins too. In case the end-user calls the same setup function, we'd end up with hooks registered multiple times. To avoid this, protection against double-registration has been introduced. The new `event_handler_hook_use` and `loop_hook_use` functions will only allow one copy of the hook. The `event_handler_hook_append` and `loop_hook_append` functions will, on the other hand, just append the hooks, and not care about protection. The `event_handler_hook_add` and `loop_hook_add` functions are gone, but for the time being, they are aliases to the `_use` functions, until all plugins have been updated, and the aliases can be removed. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>pull/91/head
parent
867f9507ed
commit
eb02ca5fe6
Loading…
Reference in new issue