X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-mail-operation-queue.c;h=db3465fcea1f7c61fd8387ba8620fced5281ad88;hp=faab5c5302421d613484c7d4eb4486ae11c6a6db;hb=dafad623b1c0f184142ce09a51882fa967d7eb09;hpb=c0953502e6737cd36877e8564502343ba4fb75ea diff --git a/src/modest-mail-operation-queue.c b/src/modest-mail-operation-queue.c index faab5c5..db3465f 100644 --- a/src/modest-mail-operation-queue.c +++ b/src/modest-mail-operation-queue.c @@ -257,9 +257,9 @@ modest_mail_operation_queue_remove (ModestMailOperationQueue *self, prevent possible application crashes. It's useful also for detecting mail operations with invalid status and error handling */ - if (modest_mail_operation_get_error (mail_op) != NULL) + if (modest_mail_operation_get_error (mail_op) != NULL) { modest_mail_operation_execute_error_handler (mail_op); - else { + } else { if (status == MODEST_MAIL_OPERATION_STATUS_CANCELED) g_warning ("%s: operation canceled \n", __FUNCTION__); else @@ -316,6 +316,7 @@ modest_mail_operation_queue_cancel (ModestMailOperationQueue *self, static void on_cancel_all_foreach (gpointer op, gpointer list) { + g_return_if_fail (list); *((GSList**)list) = g_slist_prepend (*((GSList**)list), MODEST_MAIL_OPERATION (op)); } @@ -323,8 +324,8 @@ void modest_mail_operation_queue_cancel_all (ModestMailOperationQueue *self) { ModestMailOperationQueuePrivate *priv; - GSList* operations_to_cancel; - GSList* cur; + GSList* operations_to_cancel = NULL; + GSList* cur = NULL; g_return_if_fail (MODEST_IS_MAIL_OPERATION_QUEUE (self)); @@ -338,7 +339,7 @@ modest_mail_operation_queue_cancel_all (ModestMailOperationQueue *self) g_mutex_lock (priv->queue_lock); g_queue_foreach (priv->op_queue, (GFunc) on_cancel_all_foreach, &operations_to_cancel); g_mutex_unlock (priv->queue_lock); - + /* TODO: Reverse the list, to remove operations in order? */ for(cur = operations_to_cancel; cur != NULL; cur = cur->next) {