/* Add operation observers and change toolbar if neccessary*/
tmp = priv->progress_widgets;
if (mode == TOOLBAR_MODE_TRANSFER) {
- if (mode_changed && (G_OBJECT (self) == modest_mail_operation_get_source(mail_op)))
- set_toolbar_transfer_mode(self);
+ if (mode_changed) {
+ if (G_OBJECT (self) == modest_mail_operation_get_source(mail_op)) {
+ set_toolbar_transfer_mode(self);
+ }
+ g_object_unref (G_OBJECT (mail_op));
+ }
while (tmp) {
modest_progress_object_add_operation (MODEST_PROGRESS_OBJECT (tmp->data),
}
}
}
+ g_object_unref (G_OBJECT (mail_op));
}
static void
FindBySourceInfo *info = (FindBySourceInfo*) data;
if ( info->source == modest_mail_operation_get_source (MODEST_MAIL_OPERATION (op))) {
- *(info->new_list) = g_slist_prepend (*(info->new_list), MODEST_MAIL_OPERATION (op));
+ g_object_ref (G_OBJECT (op));
+ *(info->new_list) = g_slist_prepend (*(info->new_list), MODEST_MAIL_OPERATION (op));
}
}
if (type == MODEST_MAIL_OPERATION_TYPE_RECEIVE || type == MODEST_MAIL_OPERATION_TYPE_OPEN) {
modest_mail_operation_cancel (pending_ops->data);
}
+ g_object_unref (G_OBJECT (pending_ops->data));
tmp_list = pending_ops;
pending_ops = g_slist_next (pending_ops);
g_slist_free_1 (tmp_list);