From: Colin Leroy Date: Tue, 19 Jun 2007 21:36:55 +0000 (+0000) Subject: 2007-06-19 [colin] 2.9.2cvs71 X-Git-Tag: rel_2_10_0~9 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=cd3ae7ab6d9f7c6815b1c1c349ccbc7cc4a5215b 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. --- diff --git a/ChangeLog b/ChangeLog index 3b62a5e67..9cd723c39 100644 --- 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 diff --git a/PATCHSETS b/PATCHSETS index cd110cd79..4e9fb6613 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2646,3 +2646,4 @@ ( 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 diff --git a/configure.ac b/configure.ac index 472b964b0..7cd107d85 100644 --- a/configure.ac +++ b/configure.ac @@ -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= diff --git a/src/compose.c b/src/compose.c index dfb9d47c6..b8b1d2a06 100644 --- a/src/compose.c +++ b/src/compose.c @@ -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); } diff --git a/src/messageview.c b/src/messageview.c index b5d501eb2..7aa37a24f 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -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) &&