aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-composer-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-composer-utils.c')
-rw-r--r--mail/em-composer-utils.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 8c98040ada..1dfa3c4a58 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -85,6 +85,7 @@ struct _AsyncContext {
gchar *folder_uri;
gchar *message_uid;
gboolean replace;
+ GtkWidget *destroy_when_done;
};
struct _ForwardData {
@@ -112,6 +113,9 @@ async_context_free (AsyncContext *context)
if (context->ptr_array != NULL)
g_ptr_array_unref (context->ptr_array);
+ if (context->destroy_when_done != NULL)
+ gtk_widget_destroy (context->destroy_when_done);
+
g_free (context->folder_uri);
g_free (context->message_uid);
@@ -1680,6 +1684,7 @@ forward_got_messages_cb (CamelFolder *folder,
if (e_activity_handle_cancellation (context->activity, error)) {
g_warn_if_fail (hash_table == NULL);
+ context->destroy_when_done = NULL;
async_context_free (context);
g_error_free (error);
return;
@@ -1690,6 +1695,7 @@ forward_got_messages_cb (CamelFolder *folder,
alert_sink,
"mail:get-multiple-messages",
error->message, NULL);
+ context->destroy_when_done = NULL;
async_context_free (context);
g_error_free (error);
return;
@@ -1721,6 +1727,7 @@ forward_got_messages_cb (CamelFolder *folder,
* @folder: folder containing messages to forward
* @uids: uids of messages to forward
* @style: the forward style to use
+ * @destroy_when_done: a #GtkWidget to destroy with gtk_widget_destroy() when done; can be NULL
*
* Forwards a group of messages in the given style.
*
@@ -1742,7 +1749,8 @@ void
em_utils_forward_messages (EMailReader *reader,
CamelFolder *folder,
GPtrArray *uids,
- EMailForwardStyle style)
+ EMailForwardStyle style,
+ GtkWidget *destroy_when_done)
{
EActivity *activity;
AsyncContext *context;
@@ -1760,6 +1768,7 @@ em_utils_forward_messages (EMailReader *reader,
context->reader = g_object_ref (reader);
context->ptr_array = g_ptr_array_ref (uids);
context->style = style;
+ context->destroy_when_done = destroy_when_done;
switch (style) {
case E_MAIL_FORWARD_STYLE_ATTACHED: