From: Dirk-Jan C. Binnema Date: Wed, 4 Jul 2007 17:02:33 +0000 (+0000) Subject: * copy the list of attachments; this fixes the first X-Git-Tag: git_migration_finished~2963 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=50fb34902f76cf6f5747dd372980a7b2a188bd75 * copy the list of attachments; this fixes the first crash when closing a edit window with a message with an attachment pmo-trunk-r2575 --- diff --git a/src/maemo/modest-msg-edit-window.c b/src/maemo/modest-msg-edit-window.c index 67f6917..176dd2b 100644 --- a/src/maemo/modest-msg-edit-window.c +++ b/src/maemo/modest-msg-edit-window.c @@ -1071,7 +1071,16 @@ modest_msg_edit_window_get_msg_data (ModestMsgEditWindow *edit_window) else data->html_body = NULL; - data->attachments = priv->attachments; /* TODO: copy and free ? */ + /* deep-copy the data */ + GList *cursor = priv->attachments; + data->attachments = NULL; + while (cursor) { + data->attachments = g_list_append (data->attachments, + g_strdup ((gchar*)cursor->data)); + cursor = g_list_next (cursor); + } + + data->priority_flags = priv->priority_flags; return data; @@ -1103,8 +1112,6 @@ modest_msg_edit_window_free_msg_data (ModestMsgEditWindow *edit_window, g_list_foreach (data->attachments, (GFunc)g_free, NULL); g_list_free (data->attachments); - /* TODO: Free data->attachments? */ - g_slice_free (MsgData, data); }