0.9.3claws23
[claws.git] / src / plugins / trayicon / trayicon.c
index 082e49f9c49a643e62cab7da77cd6332ae4c62fc..56f185955a4f11fbbefda31b5a1b857fce369c0f 100644 (file)
@@ -35,7 +35,7 @@
 #include "unreadmail.xpm"
 #include "nomail.xpm"
 
-static gint hook_id;
+static guint hook_id;
 
 static GdkPixmap *newmail_pixmap;
 static GdkPixmap *newmail_bitmap;
@@ -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);
 }