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 5d06f6e6a238ab59dcecae6941d0b577ccc0dc89..589067e2f1bbf3d7041ae61df514b2eccca384b6 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 a90e42aeaeb8d2431bcd43916b1c9c3e99450751..68ace396432701f54aec7d29f8504115c1ebc56a 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 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
index e138e9cf4cd73e3fb7d5f1ea1b704e9136fb0c7a..56f185955a4f11fbbefda31b5a1b857fce369c0f 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);
 }