0.9.3claws23
[claws.git] / src / common / hooks.c
index 149141e7813d4e3bb04261e8fe23c9fa0dd40706..cfca1b3f6bf961a7fb11b271bce70c6e9eab6083 100644 (file)
 
 #include <glib.h>
 
+#include "utils.h"
 #include "hooks.h"
 
-GHashTable *hooklist_table;
+static GHashTable *hooklist_table;
 
 GHookList *hooks_get_hooklist(gchar *hooklist_name)
 {
@@ -66,6 +67,8 @@ guint hooks_register_hook(gchar *hooklist_name,
 
        g_hook_append(hooklist, hook);
 
+       debug_print("registed new hook for '%s' as id %d\n", hooklist_name, hook->hook_id);
+
        return hook->hook_id;
 }
 
@@ -83,7 +86,9 @@ void hooks_unregister_hook(gchar *hooklist_name,
        hook = g_hook_get(hooklist, hook_id);
        g_return_if_fail(hook != NULL);
 
-       g_hook_destroy_link(hooklist, hook);
+       debug_print("unregisted hook %d in '%s'\n", hook->hook_id, hooklist_name);
+
+       g_hook_destroy(hooklist, hook);
 }
 
 struct MarshalData