* Fixes NB#80734, now dimming rules of menubar are evaluated when the mail operation...
[modest] / src / modest-tny-account-store.c
index ac77bfc..6fbc996 100644 (file)
@@ -853,6 +853,8 @@ modest_tny_account_store_finalize (GObject *obj)
                camel_object_unref (CAMEL_OBJECT(priv->session));
                priv->session = NULL;
        }
+
+       camel_shutdown ();
        
        G_OBJECT_CLASS(parent_class)->finalize (obj);
 }
@@ -1346,8 +1348,8 @@ modest_tny_account_store_get_server_account (ModestTnyAccountStore *self,
 }
 
 TnyAccount*
-modest_tny_account_store_get_smtp_specific_transport_account_for_open_connection (ModestTnyAccountStore *self,
-                                                                                 const gchar *account_name)
+modest_tny_account_store_get_smtp_specific_transport_account_for_open_connection (
+       ModestTnyAccountStore *self, const gchar *account_name)
 {
        TnyDevice *device;
 
@@ -1356,7 +1358,12 @@ modest_tny_account_store_get_smtp_specific_transport_account_for_open_connection
 
        /* Get the current connection: */
        device = modest_runtime_get_device ();
-       
+
+       if (!device) {
+               g_warning ("%s: could not get device", __FUNCTION__);
+               return NULL;
+       }
+               
        if (!tny_device_is_online (device))
                return NULL;