X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-tny-account-store.c;h=0011265f84557ff3e4f2787079c82d5160cba47c;hp=d2ba6a6de69c52b7e0164903e6e7daa75929ce3f;hb=c170ec4bf55d203ce2dca06f59d06f5a9cf3865b;hpb=68038836eb76f43910cf943e03a09567ec6448f6 diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index d2ba6a6..0011265 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -1660,12 +1660,16 @@ on_account_removed (ModestAccountMgr *acc_mgr, const gchar *account, /* If there was any problem creating the account, for example, with the configuration system this could not exist */ if (store_account) { + + /* do this before deleting the cache */ + account_disconnect (store_account); + /* Clear the cache */ tny_store_account_delete_cache (TNY_STORE_ACCOUNT (store_account)); /* Notify the observers */ g_signal_emit (G_OBJECT (self), signals [ACCOUNT_REMOVED_SIGNAL], 0, store_account); - account_disconnect (store_account); /* disconnect the account */ + g_object_unref (store_account); } else { g_warning ("There is no store account for account %s\n", account);