From 8427b2c852ed5200e28aaee5f8a74c678d931b25 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 1 Oct 2002 21:21:03 +0000 Subject: When signing/encrypting a part, if a USER_CANCEL occurs, re-use the part 2002-10-01 Jeffrey Stedfast * e-msg-composer.c (build_message): When signing/encrypting a part, if a USER_CANCEL occurs, re-use the part otherwise unref it and replace it with the new part. svn path=/trunk/; revision=18290 --- composer/ChangeLog | 6 ++++++ composer/e-msg-composer.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'composer') diff --git a/composer/ChangeLog b/composer/ChangeLog index d4704eb554..3aebb93f91 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,9 @@ +2002-10-01 Jeffrey Stedfast + + * e-msg-composer.c (build_message): When signing/encrypting a + part, if a USER_CANCEL occurs, re-use the part otherwise unref it + and replace it with the new part. + 2002-09-30 Aaron Weber * evolution-composer.c (evolution_composer_factory_init): adjust string on line 391 diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 1dfe6667fe..383f8e5475 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -526,7 +526,6 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data) mps = camel_multipart_signed_new (); camel_multipart_signed_sign (mps, cipher, part, userid, CAMEL_CIPHER_HASH_SHA1, &ex); camel_object_unref (cipher); - camel_object_unref (part); if (from) camel_object_unref (from); @@ -536,10 +535,12 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data) if (camel_exception_get_id (&ex) == CAMEL_EXCEPTION_USER_CANCEL) { camel_exception_clear (&ex); } else { + camel_object_unref (part); camel_object_unref (mps); goto exception; } } else { + camel_object_unref (part); part = camel_mime_part_new (); camel_multipart_set_boundary (CAMEL_MULTIPART (mps), NULL); camel_medium_set_content_object (CAMEL_MEDIUM (part), (CamelDataWrapper *) mps); @@ -602,7 +603,6 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data) camel_multipart_encrypted_encrypt (mpe, part, cipher, userid, recipients, &ex); camel_object_unref (cipher); - camel_object_unref (part); if (from) camel_object_unref (from); @@ -617,9 +617,11 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data) camel_exception_clear (&ex); } else { camel_object_unref (mpe); + camel_object_unref (part); goto exception; } } else { + camel_object_unref (part); part = camel_mime_part_new (); camel_multipart_set_boundary (CAMEL_MULTIPART (mpe), NULL); camel_medium_set_content_object (CAMEL_MEDIUM (part), (CamelDataWrapper *) mpe); -- cgit v1.2.3