[evolution] Bug 697632 - [mail-to-task] Invalid unref of a CamelFolder



commit f0151c785648b44850b46fa50336126c282fcc58
Author: Samarjit Adhikari <samarjit adhikari gmail com>
Date:   Sun May 12 08:27:36 2013 -0400

    Bug 697632 - [mail-to-task] Invalid unref of a CamelFolder
    
    e_mail_reader_get_folder() does not return a new CamelFolder reference,
    yet mail_to_event() was acting as though it does.  This caused a crash
    after the function ran and Evolution tried to use the folder again.
    
    Truth be told, e_mail_reader_get_folder() really *should* return a new
    reference to ensure the CamelFolder is not finalized while it's in use.
    But we would need to rename the function to e_mail_reader_ref_folder()
    to reflect the change in semantics, and I suspect the function is used
    in a great many places.

 plugins/mail-to-task/mail-to-task.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index 34473bc..0293701 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -1130,7 +1130,6 @@ mail_to_event (ECalClientSourceType source_type,
 
                if (response == GTK_RESPONSE_NO) {
                        em_utils_uids_free (uids);
-                       g_object_unref (folder);
                        return;
                }
        }
@@ -1199,7 +1198,6 @@ mail_to_event (ECalClientSourceType source_type,
                e_notice (NULL, GTK_MESSAGE_ERROR, _("No writable calendar is available."));
 
                em_utils_uids_free (uids);
-               g_object_unref (folder);
                if (error)
                        g_error_free (error);
                goto exit;
@@ -1215,7 +1213,7 @@ mail_to_event (ECalClientSourceType source_type,
                data = g_new0 (AsyncData, 1);
                data->source = g_object_ref (source);
                data->source_type = source_type;
-               data->folder = folder;
+               data->folder = g_object_ref (folder);
                data->uids = uids;
                data->with_attendees = with_attendees;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]