remove_hook
remove_hook — removes a hooked function.
remove_hook (hook_sym, function_sym)
hook_symOne of several symbols used to identify a hook, as listed below.
function_symThe function that is to be removed.
The hooked function (function_sym) that was
removed.
This function removes a hook that was previously set up with add_hook. The currently
available hooks are:
taskstarted_hook |
taskdied_hook |
exception_hook |
echo_hook |
gc_hook |
trace_symbol_hook |
trace_entry_hook |
trace_exit_hook |
breakpoint_hook |
Modifying the example in add_hook by adding one line:
... add_hook (#taskstarted_hook, #hook_started); add_hook (#taskdied_hook, #hook_died); run_hooks (#taskstarted_hook, "testing start"); run_hooks (#taskdied_hook, "testing died"); /* Remove the hook */ remove_hook (#taskstarted_hook, #hook_started); while(t) ...
would remove the taskstarted_hook.