Corrected ref and unref of mail operations.
authorFelipe Erias Morandeira <femorandeira@igalia.com>
Fri, 14 Dec 2007 12:30:42 +0000 (12:30 +0000)
committerFelipe Erias Morandeira <femorandeira@igalia.com>
Fri, 14 Dec 2007 12:30:42 +0000 (12:30 +0000)
pmo-trunk-r3918

src/maemo/modest-main-window.c
src/maemo/modest-msg-view-window.c
src/modest-mail-operation-queue.c
src/widgets/modest-window-mgr.c

index e827044..60ebdf6 100644 (file)
@@ -2216,8 +2216,12 @@ on_mail_operation_started (ModestMailOperation *mail_op,
        /* 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),
index 7246417..85e3c5d 100644 (file)
@@ -2195,6 +2195,7 @@ on_mail_operation_started (ModestMailOperation *mail_op,
                        }
                }
        }
+       g_object_unref (G_OBJECT (mail_op));
 }
 
 static void 
index 19cb4ed..a05c8fd 100644 (file)
@@ -385,7 +385,8 @@ on_find_by_source_foreach (gpointer op, gpointer data)
        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));
        }
 }
 
index 80731e7..6d03595 100644 (file)
@@ -796,6 +796,7 @@ modest_window_mgr_unregister_window (ModestWindowMgr *self,
                        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);