Fixed several TnyIterator leaks
authorAlberto Garcia <agarcia@igalia.com>
Wed, 30 Jan 2008 17:32:33 +0000 (17:32 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Wed, 30 Jan 2008 17:32:33 +0000 (17:32 +0000)
pmo-trunk-r4115

src/maemo/modest-msg-edit-window.c
src/modest-tny-account-store.c
src/modest-ui-actions.c

index aab42cb..0f127a3 100644 (file)
@@ -1008,6 +1008,7 @@ replace_with_images (ModestMsgEditWindow *self, TnyList *attachments)
                }
                g_object_unref (part);
        }
+       g_object_unref (iter);
 }
 
 static void
@@ -1085,6 +1086,7 @@ update_last_cid (ModestMsgEditWindow *self, TnyList *attachments)
                }
                g_object_unref (part);
        }
+       g_object_unref (iter);
 }
 
 static void
@@ -1628,6 +1630,7 @@ modest_msg_edit_window_get_msg_data (ModestMsgEditWindow *edit_window)
                g_object_unref (part);
                tny_iterator_next (att_iter);
        }
+       g_object_unref (att_iter);
        
        data->priority_flags = priv->priority_flags;
 
@@ -2336,6 +2339,7 @@ modest_msg_edit_window_remove_attachments (ModestMsgEditWindow *window,
                        gtk_text_buffer_set_modified (priv->text_buffer, TRUE);
                        g_object_unref (mime_part);
                }
+               g_object_unref (iter);
        }
 
        g_object_unref (att_list);
index 63f2ab6..ac77bfc 100644 (file)
@@ -1332,6 +1332,7 @@ modest_tny_account_store_get_server_account (ModestTnyAccountStore *self,
                g_object_unref (tmp_account);
                tny_iterator_next (iter);
        }
+       g_object_unref (iter);
 
        if (!found) {
                g_printerr ("modest: %s: could not get tny %s account for %s\n." \
@@ -1851,6 +1852,7 @@ modest_tny_account_store_find_msg_in_outboxes (ModestTnyAccountStore *self,
                        g_object_unref (folder);
                        tny_iterator_next (folders_iter);
                }
+               g_object_unref (folders_iter);
 
                g_object_unref (folders);
                g_object_unref (account);
index 0a08812..f6f7892 100644 (file)
@@ -4470,6 +4470,7 @@ open_msg_for_purge_cb (ModestMailOperation *mail_op,
 
                                tny_iterator_next (iter);
                        }
+                       g_object_unref (iter);
                        
                        tny_msg_rewrite_cache (msg);
                }
@@ -4477,7 +4478,6 @@ open_msg_for_purge_cb (ModestMailOperation *mail_op,
                /* This string no longer exists, refer to NB#75415 for more info */
                /* modest_platform_information_banner (NULL, NULL, _("mail_ib_attachment_already_purged")); */
        }
-       g_object_unref (iter);
 
        modest_window_mgr_unregister_header (mgr, header);
 
@@ -4490,7 +4490,6 @@ modest_ui_actions_on_main_window_remove_attachments (GtkAction *action,
 {
        GtkWidget *header_view;
        TnyList *header_list;
-       TnyIterator *iter;
        TnyHeader *header;
        TnyHeaderFlags flags;
        ModestWindow *msg_view_window =  NULL;
@@ -4508,7 +4507,7 @@ modest_ui_actions_on_main_window_remove_attachments (GtkAction *action,
        }
        
        if (tny_list_get_length (header_list) == 1) {
-               iter = tny_list_create_iterator (header_list);
+               TnyIterator *iter = tny_list_create_iterator (header_list);
                header = TNY_HEADER (tny_iterator_get_current (iter));
                g_object_unref (iter);
        } else