* src/compose.[ch]
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Fri, 27 Feb 2004 16:15:39 +0000 (16:15 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Fri, 27 Feb 2004 16:15:39 +0000 (16:15 +0000)
Explicitly remove draft timeout to fix nasty race between
compose_send_cb() (which destroys the compose window) and
compose_defer_auto_save_draft() (which expects compose
window to exist). Should fix Keith's and Fred Malton's
bug report (#128, "crash after complaining about character
set conversion")

ChangeLog.claws
configure.ac
src/compose.c
src/compose.h

index bc02032..bae1b74 100644 (file)
@@ -1,3 +1,13 @@
+2004-02-27 [alfons]    0.9.9claws35
+
+       * src/compose.[ch]
+               Explicitly remove draft timeout to fix nasty race between 
+               compose_send_cb() (which destroys the compose window) and 
+               compose_defer_auto_save_draft() (which expects compose 
+               window to exist). Should fix Keith's and Fred Malton's
+               bug report (#128, "crash after complaining about character
+               set conversion")
+
 2004-02-27 [luke]      0.9.9claws34
        
        * src/folder.c
index bdd426e..df56e63 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=9
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=34
+EXTRA_VERSION=35
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index aaa131f..ce4f812 100644 (file)
@@ -5255,6 +5255,7 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        compose->exteditor_pid     = -1;
        compose->exteditor_readdes = -1;
        compose->exteditor_tag     = -1;
+       compose->draft_timeout_tag = -1;
 
 #if USE_ASPELL
        menu_set_sensitive(ifactory, "/Spelling", FALSE);
@@ -6404,6 +6405,11 @@ static void compose_send_cb(gpointer data, guint action, GtkWidget *widget)
                               _("Yes"), _("No"), NULL) != G_ALERTDEFAULT)
                        return;
        
+       if (compose->draft_timeout_tag != -1) { /* CLAWS: disable draft timeout */
+               gtk_timeout_remove(compose->draft_timeout_tag);
+               compose->draft_timeout_tag = -1;
+       }
+
        compose_allow_user_actions (compose, FALSE);
        compose->sending = TRUE;
        val = compose_send(compose);
@@ -7224,11 +7230,13 @@ static void text_inserted(GtkWidget *widget, const gchar *text,
 
        if (prefs_common.autosave && 
            gtk_stext_get_length(GTK_STEXT(widget)) % prefs_common.autosave_length == 0)
-               gtk_timeout_add(500, (GtkFunction) compose_defer_auto_save_draft, compose);
+               compose->draft_timeout_tag = gtk_timeout_add
+                       (500, (GtkFunction) compose_defer_auto_save_draft, compose);
 }
 
 static gint compose_defer_auto_save_draft(Compose *compose)
 {
+       compose->draft_timeout_tag = -1;
        compose_draft_cb((gpointer)compose, 2, NULL);
        return FALSE;
 }
index 68e0f0b..efd6f86 100644 (file)
@@ -207,6 +207,8 @@ struct _Compose
        gchar *redirect_filename;
        
        gboolean remove_references;
+
+       guint draft_timeout_tag;
 };
 
 struct _AttachInfo