/* Removes all the #GHook elements from a #GHookList.  */
void g_hook_list_clear(GHookList *hook_list)
/* Removes all the #GHook elements from a #GHookList.  */
void g_hook_list_clear(GHookList *hook_list)
{
  g_return_if_fail (hook_list != NULL);
  if (hook_list->is_setup)
    {
      GHook *hook;
      hook_list->is_setup = FALSE;
      hook = hook_list->hooks;
      if (!hook)
	{
	}
      else
	do
	  {
	    GHook *tmp;
	    g_hook_ref (hook_list, hook);
	    g_hook_destroy_link (hook_list, hook);
	    tmp = hook->next;
	    g_hook_unref (hook_list, hook);
	    hook = tmp;
	  }
	while (hook);
    }
}