2007-06-19 [colin] 2.9.2cvs71
authorColin Leroy <colin@colino.net>
Tue, 19 Jun 2007 21:36:55 +0000 (21:36 +0000)
committerColin Leroy <colin@colino.net>
Tue, 19 Jun 2007 21:36:55 +0000 (21:36 +0000)
* src/compose.c
* src/messageview.c
Fix crash mentioned in bug 1246
Race condition when automatically drafting
due to insertion on reedit.

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/messageview.c

index 3b62a5e6707fa88084f0d037276a931f4542fb67..9cd723c395f12756b373d71e4840e411de1d82cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-06-19 [colin]     2.9.2cvs71
+
+       * src/compose.c
+       * src/messageview.c
+               Fix crash mentioned in bug 1246
+               Race condition when automatically drafting
+               due to insertion on reedit.
+
 2007-06-18 [wwp]       2.9.2cvs70
 
        * src/importldif.c
index cd110cd7978434eaf9e71878b3fde7858d1344df..4e9fb66131fc783ad500ed7a872eaab350dfc5b9 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.12.2.12 -r 1.12.2.13 src/ldif.c;  cvs diff -u -r 1.14.2.13 -r 1.14.2.14 src/importldif.c;  ) > 2.9.2cvs68.patchset
 ( cvs diff -u -r 1.654.2.2699 -r 1.654.2.2700 configure.ac;  ) > 2.9.2cvs69.patchset
 ( cvs diff -u -r 1.14.2.14 -r 1.14.2.15 src/importldif.c;  ) > 2.9.2cvs70.patchset
+( cvs diff -u -r 1.382.2.390 -r 1.382.2.391 src/compose.c;  cvs diff -u -r 1.94.2.135 -r 1.94.2.136 src/messageview.c;  ) > 2.9.2cvs71.patchset
index 472b964b0301b74ba4422f6a2fa3f7f237bb0fce..7cd107d85252cb9ae35fe686bf593cbb6d911dca 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=70
+EXTRA_VERSION=71
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index dfb9d47c63d935ff90bdc8e1cf91d49c59540888..b8b1d2a062eac997619e0f68990c2279205577c0 100644 (file)
@@ -1505,6 +1505,7 @@ static Compose *compose_generic_reply(MsgInfo *msginfo,
        compose_set_title(compose);
 
        compose->updating = FALSE;
+       compose->draft_timeout_tag = -1; /* desinhibit auto-drafting after loading */
 
        if (compose->deferred_destroy) {
                compose_destroy(compose);
@@ -1650,6 +1651,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
        compose_set_title(compose);
 
        compose->updating = FALSE;
+       compose->draft_timeout_tag = -1; /* desinhibit auto-drafting after loading */
 
        if (compose->deferred_destroy) {
                compose_destroy(compose);
@@ -1751,6 +1753,7 @@ static Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_
        compose_set_title(compose);
 
        compose->updating = FALSE;
+       compose->draft_timeout_tag = -1; /* desinhibit auto-drafting after loading */
 
        if (compose->deferred_destroy) {
                compose_destroy(compose);
@@ -2036,6 +2039,7 @@ Compose *compose_reedit(MsgInfo *msginfo, gboolean batch)
        compose_set_title(compose);
 
        compose->updating = FALSE;
+       compose->draft_timeout_tag = -1; /* desinhibit auto-drafting after loading */
 
        if (compose->deferred_destroy) {
                compose_destroy(compose);
@@ -2144,6 +2148,7 @@ Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo,
        compose->modified = FALSE;
        compose_set_title(compose);
        compose->updating = FALSE;
+       compose->draft_timeout_tag = -1; /* desinhibit auto-drafting after loading */
 
        if (compose->deferred_destroy) {
                compose_destroy(compose);
@@ -6623,7 +6628,7 @@ static Compose *compose_create(PrefsAccount *account,
        compose->exteditor_file    = NULL;
        compose->exteditor_pid     = -1;
        compose->exteditor_tag     = -1;
-       compose->draft_timeout_tag = -1;
+       compose->draft_timeout_tag = -2; /* inhibit auto-drafting while loading */
 
 #if USE_ASPELL
        menu_set_sensitive(ifactory, "/Spelling", FALSE);
@@ -8218,7 +8223,7 @@ static void compose_send_cb(gpointer data, guint action, GtkWidget *widget)
                  "to send this email.")))
                return;
        
-       if (compose->draft_timeout_tag != -1) { /* CLAWS: disable draft timeout */
+       if (compose->draft_timeout_tag >= 0) { /* CLAWS: disable draft timeout */
                g_source_remove(compose->draft_timeout_tag);
                compose->draft_timeout_tag = -1;
        }
@@ -9636,7 +9641,8 @@ static void text_inserted(GtkTextBuffer *buffer, GtkTextIter *iter,
        g_signal_stop_emission_by_name(G_OBJECT(buffer), "insert-text");
 
        if (prefs_common.autosave && 
-           gtk_text_buffer_get_char_count(buffer) % prefs_common.autosave_length == 0)
+           gtk_text_buffer_get_char_count(buffer) % prefs_common.autosave_length == 0 &&
+           compose->draft_timeout_tag != -2 /* disabled while loading */)
                compose->draft_timeout_tag = g_timeout_add
                        (500, (GtkFunction) compose_defer_auto_save_draft, compose);
 }
index b5d501eb2aee4fe8d8ade004caef5be29dcffb60..7aa37a24fcbd0a57c42ea9da06b5885ca25fba63 100644 (file)
@@ -888,11 +888,11 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
 
        main_create_mailing_list_menu(messageview->mainwin, messageview->msginfo);
 
-       if (messageview->msginfo->extradata
+       if (messageview->msginfo && messageview->msginfo->extradata
            && messageview->msginfo->extradata->partial_recv)
                partial_recv_show(messageview->noticeview, 
                                  messageview->msginfo);
-       else if (messageview->msginfo->extradata &&
+       else if (messageview->msginfo && messageview->msginfo->extradata &&
            (messageview->msginfo->extradata->dispositionnotificationto || 
             messageview->msginfo->extradata->returnreceiptto) &&
            !MSG_IS_RETRCPT_SENT(messageview->msginfo->flags) &&