/* Calls the #GHookList @finalize_hook function if it exists, and frees the memory allocated for the #GHook.  */
void g_hook_free(GHookList *hook_list, GHook *hook)
/* Calls the #GHookList @finalize_hook function if it exists, and frees the memory allocated for the #GHook.  */
void g_hook_free(GHookList *hook_list, GHook *hook)
{
  g_return_if_fail (hook_list != NULL);
  g_return_if_fail (hook_list->is_setup);
  g_return_if_fail (hook != NULL);
  g_return_if_fail (G_HOOK_IS_UNLINKED (hook));
  g_return_if_fail (!G_HOOK_IN_CALL (hook));
  if(hook_list->finalize_hook != NULL)
      hook_list->finalize_hook (hook_list, hook);
  g_slice_free1 (hook_list->hook_size, hook);
}