[evolution-patches] 66943, crash saving draft
- From: Not Zed <notzed novell com>
- To: asdf <evolution-patches lists ximian com>
- Subject: [evolution-patches] 66943, crash saving draft
- Date: Wed, 19 Jan 2005 16:05:20 +0800
basically the synchronised async folder loading can let everything get destroyed, so this gets everything it needs first
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3444.2.33
diff -u -p -r1.3444.2.33 ChangeLog
--- mail/ChangeLog 19 Jan 2005 03:56:16 -0000 1.3444.2.33
+++ mail/ChangeLog 19 Jan 2005 08:05:41 -0000
@@ -1,3 +1,22 @@
+2005-01-19 Not Zed <NotZed Ximian com>
+
+ ** See bug #66943.
+
+ * em-composer-utils.c (save_draft_done): check if the
+ editor_engine is still there before trying to invoke a method on
+ it.
+ (em_utils_composer_save_draft_cb): grab resources before getting
+ the folder, so the composer doesn't go away.
+
+ ** See bug #70858.
+
+ * em-folder-selector.c (folder_created_cb): removed.
+ (emfs_response): set the selected uri directly after creating it,
+ rather than doing it asynchronously.
+
+ * mail-account-gui.c (mail_account_gui_save): dont dereference
+ default folder pointers if they're NULL.
+
2005-01-18 Not Zed <NotZed Ximian com>
** See bug #70768.
Index: mail/em-composer-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-composer-utils.c,v
retrieving revision 1.21.4.2
diff -u -p -r1.21.4.2 em-composer-utils.c
--- mail/em-composer-utils.c 7 Oct 2004 01:09:09 -0000 1.21.4.2
+++ mail/em-composer-utils.c 19 Jan 2005 08:05:41 -0000
@@ -466,6 +466,7 @@ em_utils_composer_send_cb (EMsgComposer
struct _save_draft_info {
struct emcs_t *emcs;
EMsgComposer *composer;
+ CamelMessageInfo *info;
int quit;
};
@@ -479,10 +480,12 @@ save_draft_done (CamelFolder *folder, Ca
if (!ok)
goto done;
-
- CORBA_exception_init (&ev);
- GNOME_GtkHTML_Editor_Engine_runCommand (sdi->composer->editor_engine, "saved", &ev);
- CORBA_exception_free (&ev);
+
+ if (sdi->composer->editor_engine) {
+ CORBA_exception_init (&ev);
+ GNOME_GtkHTML_Editor_Engine_runCommand (sdi->composer->editor_engine, "saved", &ev);
+ CORBA_exception_free (&ev);
+ }
if ((emcs = sdi->emcs) == NULL) {
emcs = emcs_new ();
@@ -553,8 +556,22 @@ em_utils_composer_save_draft_cb (EMsgCom
CamelMimeMessage *msg;
CamelMessageInfo *info;
EAccount *account;
-
+
+ /* need to get stuff from the composer here, since it could
+ * get destroyed while we're in mail_msg_wait() a little lower
+ * down, waiting for the folder to open */
+
+ g_object_ref(composer);
+ msg = e_msg_composer_get_message_draft (composer);
account = e_msg_composer_get_preferred_account (composer);
+
+ sdi = g_malloc(sizeof(struct _save_draft_info));
+ sdi->composer = composer;
+ sdi->emcs = user_data;
+ if (sdi->emcs)
+ emcs_ref(sdi->emcs);
+ sdi->quit = quit;
+
if (account && account->drafts_folder_uri &&
strcmp (account->drafts_folder_uri, default_drafts_folder_uri) != 0) {
int id;
@@ -563,8 +580,14 @@ em_utils_composer_save_draft_cb (EMsgCom
mail_msg_wait (id);
if (!folder) {
- if (e_error_run((GtkWindow *)composer, "mail:ask-default-drafts", NULL) != GTK_RESPONSE_YES)
+ if (e_error_run((GtkWindow *)composer, "mail:ask-default-drafts", NULL) != GTK_RESPONSE_YES) {
+ g_object_unref(composer);
+ camel_object_unref(msg);
+ if (sdi->emcs)
+ emcs_unref(sdi->emcs);
+ g_free(sdi);
return;
+ }
folder = drafts_folder;
camel_object_ref (drafts_folder);
@@ -574,19 +597,9 @@ em_utils_composer_save_draft_cb (EMsgCom
camel_object_ref (folder);
}
- msg = e_msg_composer_get_message_draft (composer);
-
- info = g_new0 (CamelMessageInfo, 1);
+ info = g_malloc0(sizeof(*info));
info->flags = CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_SEEN;
-
- sdi = g_malloc (sizeof (struct _save_draft_info));
- sdi->composer = composer;
- g_object_ref (composer);
- sdi->emcs = user_data;
- if (sdi->emcs)
- emcs_ref (sdi->emcs);
- sdi->quit = quit;
-
+
mail_append_mail (folder, msg, info, save_draft_done, sdi);
camel_object_unref (folder);
camel_object_unref (msg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]