* 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 bc02032431501fcd4eb670c73d02ec8a6f2a1521..bae1b74dec7d6e778f40c50f37a397cac3b48a0c 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
 2004-02-27 [luke]      0.9.9claws34
        
        * src/folder.c
index bdd426e0d43c68f68bc16b6f39fedf68c98fcb1a..df56e63f50fa7a708719cf0c87c44917d8384be2 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=9
 INTERFACE_AGE=0
 BINARY_AGE=0
 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
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index aaa131fcd692b10415a630a8f727ae00bdd30530..ce4f8120382dcde45b7512970572b6d00c9a9edc 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->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);
 
 #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;
        
                               _("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);
        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)
 
        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)
 {
 }
 
 static gint compose_defer_auto_save_draft(Compose *compose)
 {
+       compose->draft_timeout_tag = -1;
        compose_draft_cb((gpointer)compose, 2, NULL);
        return FALSE;
 }
        compose_draft_cb((gpointer)compose, 2, NULL);
        return FALSE;
 }
index 68e0f0b759f87a66635c82ff747b8bc76bd6819a..efd6f86465d0b9ea48342655a060b2630b69fa43 100644 (file)
@@ -207,6 +207,8 @@ struct _Compose
        gchar *redirect_filename;
        
        gboolean remove_references;
        gchar *redirect_filename;
        
        gboolean remove_references;
+
+       guint draft_timeout_tag;
 };
 
 struct _AttachInfo
 };
 
 struct _AttachInfo