From: Sergio Villar Senin Date: Fri, 7 Mar 2008 08:57:54 +0000 (+0000) Subject: * Most likely fixes the crash when s&r in the background X-Git-Tag: git_migration_finished~1580 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=f61c492d279c559b9f8b9b3fcea3d7a66f45578a * Most likely fixes the crash when s&r in the background * Fixes a bug in the send queue error handler (freeing a const char *) pmo-trunk-r4285 --- diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 51bbb8a..781d938 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -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)); diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 93e4188..e361b67 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -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