X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-tny-account-store.c;h=28d6680f463444514afcbdb82381bc7c78386d27;hb=030f24b7724d2bdd7f6584fd43bbd4904096ef6c;hp=9c34512b585d2d0f8d85771e6200eac1fadbaf5c;hpb=118aa5e8529157fb47b0db7241c7c29b7306cb8a;p=modest diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index 9c34512..28d6680 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -466,7 +466,7 @@ on_account_changed (ModestAccountMgr *acc_mgr, account_list = (account_type == TNY_ACCOUNT_TYPE_STORE ? priv->store_accounts : priv->transport_accounts); - + iter = tny_list_create_iterator (account_list); while (!tny_iterator_is_done (iter) && !found) { TnyAccount *tny_account; @@ -481,9 +481,7 @@ on_account_changed (ModestAccountMgr *acc_mgr, } tny_iterator_next (iter); } - - if (iter) - g_object_unref (iter); + g_object_unref (iter); } static void @@ -2130,7 +2128,7 @@ account_shutdown (TnyAccount *account, ShutdownOpData *op_data) } -void +void modest_tny_account_store_shutdown (ModestTnyAccountStore *self, ModestTnyAccountStoreShutdownCallback callback, gpointer userdata) @@ -2140,8 +2138,12 @@ modest_tny_account_store_shutdown (ModestTnyAccountStore *self, ModestTnyAccountStorePrivate *priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE (self); /* Get references */ - num_accounts = tny_list_get_length (priv->store_accounts) + - tny_list_get_length (priv->transport_accounts); + num_accounts = 0; + if (priv->store_accounts) + num_accounts += tny_list_get_length (priv->store_accounts); + if (priv->transport_accounts) + num_accounts += tny_list_get_length (priv->transport_accounts); + for (i = 0 ; i < num_accounts ; i++) g_object_ref (self); @@ -2156,7 +2158,7 @@ modest_tny_account_store_shutdown (ModestTnyAccountStore *self, if (priv->store_accounts) { tny_list_foreach (priv->store_accounts, (GFunc)account_shutdown, op_data); } - + if (priv->transport_accounts) { tny_list_foreach (priv->transport_accounts, (GFunc)account_shutdown, op_data); }