* Most likely fixes the crash when s&r in the background
authorSergio Villar Senin <svillar@igalia.com>
Fri, 7 Mar 2008 08:57:54 +0000 (08:57 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Fri, 7 Mar 2008 08:57:54 +0000 (08:57 +0000)
* Fixes a bug in the send queue error handler (freeing a const char *)

pmo-trunk-r4285

src/modest-mail-operation.c
src/modest-ui-actions.c

index 51bbb8a..781d938 100644 (file)
@@ -1276,7 +1276,7 @@ inbox_refreshed_cb (TnyFolder *inbox,
                retrieve_limit = G_MAXINT;
        
        /* Get per-account retrieval type */
-       retrieve_type = modest_account_mgr_get_retrieve_type (mgr, info->account_name); 
+       retrieve_type = modest_account_mgr_get_retrieve_type (mgr, info->account_name);
        headers_only = (retrieve_type == MODEST_ACCOUNT_RETRIEVE_HEADERS_ONLY);
 
        /* Order by date */
@@ -1367,9 +1367,6 @@ inbox_refreshed_cb (TnyFolder *inbox,
                }
                
                if (num_messages != 0) {
-                       /* Send mails */
-                       g_object_unref (priv->account);
-
                        /* Reenable suspended items */
                        modest_tny_send_queue_wakeup (MODEST_TNY_SEND_QUEUE (send_queue));
 
index 93e4188..e361b67 100644 (file)
@@ -5518,14 +5518,10 @@ modest_ui_actions_on_send_queue_error_happened (TnySendQueue *self,
        /* Get the server name: */
        server_account = 
                TNY_TRANSPORT_ACCOUNT (tny_camel_send_queue_get_transport_account (TNY_CAMEL_SEND_QUEUE (self)));
-       if (server_account) {
-               server_name = tny_account_get_hostname (TNY_ACCOUNT (server_account));
-                       
-               g_object_unref (server_account);
-               server_account = NULL;
-       }
-       
-       g_return_if_fail (server_name);
+       if (server_account)
+               server_name = tny_account_get_hostname (TNY_ACCOUNT (server_account));          
+       else
+               g_return_if_reached ();
 
        /* Show the appropriate message text for the GError: */
        switch (err->code) {
@@ -5554,6 +5550,7 @@ modest_ui_actions_on_send_queue_error_happened (TnySendQueue *self,
 
        modest_platform_run_information_dialog (NULL, message);
        g_free (message);
+       g_object_unref (server_account);
 }
 
 void