aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-23 00:11:59 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-05-24 04:36:02 +0800
commit9058c6f85dc49f9500e7e67819acfd8c0d2d369c (patch)
tree5802baf603e0995132e3652a6681068f0d9f060a /calendar/gui
parent256422cab27d0b7adbe99fdeaceb72cd78c129bb (diff)
downloadgsoc2013-evolution-9058c6f85dc49f9500e7e67819acfd8c0d2d369c.tar
gsoc2013-evolution-9058c6f85dc49f9500e7e67819acfd8c0d2d369c.tar.gz
gsoc2013-evolution-9058c6f85dc49f9500e7e67819acfd8c0d2d369c.tar.bz2
gsoc2013-evolution-9058c6f85dc49f9500e7e67819acfd8c0d2d369c.tar.lz
gsoc2013-evolution-9058c6f85dc49f9500e7e67819acfd8c0d2d369c.tar.xz
gsoc2013-evolution-9058c6f85dc49f9500e7e67819acfd8c0d2d369c.tar.zst
gsoc2013-evolution-9058c6f85dc49f9500e7e67819acfd8c0d2d369c.zip
Make EAttachment a little more thread-safe.
EAttachment is now used from worker threads by EMailFormatterAttachment, so add some thread-safe accessor functions to eliminate potential races. Added thread-safe functions: e_attachment_dup_disposition() e_attachment_ref_file() e_attachment_ref_file_info() e_attachment_ref_icon() e_attachment_ref_mime_part() e_attachment_dup_description() e_attachment_dup_thumbnail_path() Renamed functions: e_attachment_get_mime_type() -> e_attachment_dup_mime_type() Removed non-thread-safe functions: e_attachment_get_file() e_attachment_get_file_info() e_attachment_get_icon() e_attachment_get_mime_part() e_attachment_get_description() e_attachment_get_thumbnail_path()
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/comp-editor.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 778e69008d..39ca3a81e1 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -3208,7 +3208,7 @@ attachment_loaded_cb (EAttachment *attachment,
* So this is a lazy migration from the old form to the new.
*/
- file_info = e_attachment_get_file_info (attachment);
+ file_info = e_attachment_ref_file_info (attachment);
if (file_info == NULL) {
/* failed to load an attachment file */
e_attachment_load_handle_error (attachment, result, parent);
@@ -3225,6 +3225,8 @@ attachment_loaded_cb (EAttachment *attachment,
g_free (new_name);
}
+ g_object_unref (file_info);
+
e_attachment_load_handle_error (attachment, result, parent);
}
@@ -3703,7 +3705,7 @@ comp_editor_get_mime_attach_list (CompEditor *editor)
column_id = E_ATTACHMENT_STORE_COLUMN_ATTACHMENT;
gtk_tree_model_get (model, &iter, column_id, &attachment, -1);
- mime_part = e_attachment_get_mime_part (attachment);
+ mime_part = e_attachment_ref_mime_part (attachment);
g_object_unref (attachment);
valid = gtk_tree_model_iter_next (model, &iter);
@@ -3743,6 +3745,7 @@ comp_editor_get_mime_attach_list (CompEditor *editor)
attach_list = g_slist_append (attach_list, cal_mime_attach);
+ g_object_unref (mime_part);
g_object_unref (stream);
}