0.9.3claws23
authorChristoph Hohmann <reboot@gmx.ch>
Fri, 18 Jul 2003 15:47:27 +0000 (15:47 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Fri, 18 Jul 2003 15:47:27 +0000 (15:47 +0000)
* src/common/hooks.c
        fix crash when hooks where unregisted

* src/plugins/trayicon/trayicon.c
        unregister detroy signal before destroying the widget
        (still crashes when the plugin is unloaded)

ChangeLog.claws
configure.ac
src/common/hooks.c
src/plugins/trayicon/trayicon.c

index 5d06f6e..589067e 100644 (file)
@@ -1,3 +1,12 @@
+2003-07-18 [christoph] 0.9.3claws23
+
+       * src/common/hooks.c
+               fix crash when hooks where unregisted
+
+       * src/plugins/trayicon/trayicon.c
+               unregister detroy signal before destroying the widget
+               (still crashes when the plugin is unloaded)
+
 2003-07-18 [alfons]    0.9.3claws22
        
        * src/folderview.c
index a90e42a..68ace39 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws22
+EXTRA_VERSION=claws23
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 149141e..cfca1b3 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
index e138e9c..56f1859 100644 (file)
@@ -48,6 +48,7 @@ static EggTrayIcon *trayicon;
 static GtkWidget *eventbox;
 static GtkWidget *image;
 static GtkTooltips *tooltips;
+guint destroy_signal_id;
 
 typedef enum
 {
@@ -158,6 +159,7 @@ static void create_trayicon()
         image = gtk_pixmap_new(nomail_pixmap, nomail_bitmap);
         gtk_packer_add_defaults(GTK_PACKER(packer), GTK_WIDGET(image), GTK_SIDE_TOP, GTK_ANCHOR_CENTER, GTK_PACK_EXPAND);
 
+       destroy_signal_id =
        gtk_signal_connect(GTK_OBJECT(trayicon), "destroy",
                      GTK_SIGNAL_FUNC(destroy_cb), NULL);
        gtk_signal_connect(GTK_OBJECT(trayicon), "size_allocate",
@@ -189,6 +191,8 @@ int plugin_init(gchar **error)
 
 void plugin_done(void)
 {
+       gtk_signal_disconnect(GTK_OBJECT(trayicon), destroy_signal_id);
+
        gtk_widget_destroy(GTK_WIDGET(trayicon));
        hooks_unregister_hook(FOLDER_ITEM_UPDATE_HOOKLIST, hook_id);
 }