* src/modest-mail-operation.c:
authorJose Dapena Paz <jdapena@igalia.com>
Tue, 18 Mar 2008 10:37:34 +0000 (10:37 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Tue, 18 Mar 2008 10:37:34 +0000 (10:37 +0000)
        * Fixed a bad unreferencing of the list of folders used in
          recurse_folders_async_cb, as tinymail should keep the
          reference to it properly.
        * Now we properly add the list of folders passed in
          recurse_folders_async_cb to the list of processed folders
          even with poke all, and put te recurse code for poke all.
          This fixed last update proper refresh (fixes NB#82639).

pmo-trunk-r4324

src/modest-mail-operation.c

index 126e4a3..930b104 100644 (file)
@@ -1446,29 +1446,31 @@ recurse_folders_async_cb (TnyFolderStore *folder_store,
                                             MODEST_MAIL_OPERATION_ERROR_OPERATION_CANCELED,
                                             "canceled");
                }
-       } else if (info->poke_all) {
+       } else { 
                /* We're not getting INBOX children if we don't want to poke all */
                TnyIterator *iter = tny_list_create_iterator (list);
                while (!tny_iterator_is_done (iter)) {
                        TnyFolderStore *folder = (TnyFolderStore*) tny_iterator_get_current (iter);
-                       TnyList *folders = tny_simple_list_new ();
 
                        /* Add to the list of all folders */
                        tny_list_append (info->folders, (GObject *) folder);
                        
-                       /* Add pending call */
-                       info->pending_calls++;
-                       
-                       tny_folder_store_get_folders_async (folder, folders, NULL,
-                                                           recurse_folders_async_cb, 
-                                                           NULL, info);
+                       if (info->poke_all) {
+                               TnyList *folders = tny_simple_list_new ();
+                               /* Add pending call */
+                               info->pending_calls++;
+                               
+                               tny_folder_store_get_folders_async (folder, folders, NULL,
+                                                                   recurse_folders_async_cb, 
+                                                                   NULL, info);
+                               g_object_unref (folders);
+                       }
                        
                        g_object_unref (G_OBJECT (folder));
                        
                        tny_iterator_next (iter);           
                }
                g_object_unref (G_OBJECT (iter));
-               g_object_unref (G_OBJECT (list));
        }
 
        /* Remove my own pending call */
@@ -1607,6 +1609,7 @@ modest_mail_operation_update_account (ModestMailOperation *self,
                                            folders, NULL,
                                            recurse_folders_async_cb, 
                                            NULL, info);
+       g_object_unref (folders);
 }
 
 /*