* leak fixes; free both list and its elements when we call modest_account_mgr_account...
[modest] / src / maemo / modest-main-window.c
index 4050038..0204e87 100644 (file)
@@ -290,6 +290,7 @@ modest_main_window_init (ModestMainWindow *obj)
 
        priv = MODEST_MAIN_WINDOW_GET_PRIVATE(obj);
 
+       priv->queue_err_signals = NULL;
        priv->msg_paned    = NULL;
        priv->main_paned   = NULL;      
        priv->main_vbox    = NULL;
@@ -469,7 +470,7 @@ on_sendqueue_error_happened (TnySendQueue *self, TnyHeader *header, TnyMsg *msg,
                gchar *str = g_strdup_printf ("%s. Do you want to remove the message (%s)?",
                        err->message, tny_header_get_subject (header));
                OnResponseInfo *info = g_slice_new (OnResponseInfo);
-               GtkWidget *dialog = gtk_message_dialog_new (NULL, 0,
+               GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW (user_data), 0,
                        GTK_MESSAGE_ERROR, GTK_BUTTONS_YES_NO, str);
                g_free (str);
                info->queue = g_object_ref (self);
@@ -546,6 +547,7 @@ on_account_store_connecting_finished (TnyAccountStore *store, ModestMainWindow *
                                modest_tny_account_store_get_transport_account_for_open_connection
                                                 (modest_runtime_get_account_store(), account_name));
                        if (account) {
+                               /* Q: Is this the first location where the send-queues are requested? */
                                QueueErrorSignal *esignal = g_slice_new (QueueErrorSignal);
                                printf ("debug: %s:\n  Transport account for %s: %s\n", __FUNCTION__, account_name, 
                                        tny_account_get_id(TNY_ACCOUNT(account)));
@@ -558,9 +560,9 @@ on_account_store_connecting_finished (TnyAccountStore *store, ModestMainWindow *
                
                iter = g_slist_next (iter);
        }
-       
-       g_slist_free (account_names);
-       
+
+       modest_account_mgr_free_account_names (account_names);
+       account_names = NULL;
        
        modest_ui_actions_do_send_receive (NULL, MODEST_WINDOW (self));
 }
@@ -1177,7 +1179,8 @@ on_account_update (TnyAccountStore *account_store,
 
                iter = iter->next;
        }
-       g_slist_free (account_names);
+       modest_account_mgr_free_account_names (account_names);
+       account_names = NULL;
 
        /* Order the list of accounts by its display name */
        accounts = g_slist_sort (accounts, (GCompareFunc) compare_display_names);