diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-05-23 00:11:59 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-05-24 04:36:02 +0800 |
commit | 9058c6f85dc49f9500e7e67819acfd8c0d2d369c (patch) | |
tree | 5802baf603e0995132e3652a6681068f0d9f060a /modules/calendar | |
parent | 256422cab27d0b7adbe99fdeaceb72cd78c129bb (diff) | |
download | gsoc2013-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 'modules/calendar')
-rw-r--r-- | modules/calendar/e-cal-attachment-handler.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/calendar/e-cal-attachment-handler.c b/modules/calendar/e-cal-attachment-handler.c index 343d4bad14..8613fbf169 100644 --- a/modules/calendar/e-cal-attachment-handler.c +++ b/modules/calendar/e-cal-attachment-handler.c @@ -79,7 +79,7 @@ attachment_handler_get_component (EAttachment *attachment) e_attachment_get_saving (attachment)) return NULL; - mime_part = e_attachment_get_mime_part (attachment); + mime_part = e_attachment_ref_mime_part (attachment); if (mime_part == NULL) return NULL; @@ -90,6 +90,8 @@ attachment_handler_get_component (EAttachment *attachment) camel_data_wrapper_decode_to_stream_sync (wrapper, stream, NULL, NULL); g_object_unref (stream); + g_object_unref (mime_part); + if (buffer->len > 0) { const gchar *str; |