From 0adbb63d08342d20bdb06bed1555ad961e24032e Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Tue, 15 Aug 2000 20:59:43 +0000 Subject: Address bugzilla bug #496 svn path=/trunk/; revision=4849 --- mail/ChangeLog | 3 +++ mail/message-list.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index cb91b880bd..72e93cb7fe 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,8 @@ 2000-08-15 Peter Williams + * message-list.c (main_message_changed): Address bug #496 -- + possible race when forwading a message_changed event. + * mail-threads.c (dispatch): Close the dispatch thread's half of pipes when about to exit. (mail_operations_terminate): Close the main thread's half of the diff --git a/mail/message-list.c b/mail/message-list.c index 7e00d0ac14..c635f3ea84 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -884,12 +884,18 @@ main_message_changed (CamelObject *o, gpointer uid, gpointer user_data) uid)); if (row != -1) e_table_model_row_changed (message_list->table_model, row); + + g_free (uid); } static void message_changed (CamelObject *o, gpointer event_data, gpointer user_data) { - mail_op_forward_event (main_message_changed, o, event_data, user_data); + /* Here we copy the data because our thread may free the copy that we would reference. + * The other thread would be passed a uid parameter that pointed to freed data. + * We copy it and free it in the handler. + */ + mail_op_forward_event (main_message_changed, o, g_strdup ((gchar *)event_data), user_data); } void -- cgit v1.2.3