Bug 875675 - Remove prefs mail.account.accountX.identities and mail.account.accountX.server when an account is deleted. r=Neil
--- a/mailnews/base/src/nsMsgAccount.cpp
+++ b/mailnews/base/src/nsMsgAccount.cpp
@@ -427,10 +427,10 @@ nsMsgAccount::ToString(nsAString& aResul
}
NS_IMETHODIMP
nsMsgAccount::ClearAllValues()
{
nsresult rv = getPrefService();
NS_ENSURE_SUCCESS(rv, rv);
- return m_prefs->DeleteBranch(nullptr);
+ return m_prefs->DeleteBranch("");
}
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -707,17 +707,21 @@ nsMsgAccountManager::RemoveAccount(nsIMs
}
}
// clear out all identity information if no other account uses it.
if (!identityStillUsed)
identity->ClearAllValues();
}
}
- aAccount->ClearAllValues();
+ // It is not a critical problem if this fails as the account was already
+ // removed from the list of accounts so should not ever be referenced.
+ // Just print it out for debugging.
+ rv = aAccount->ClearAllValues();
+ NS_ASSERTION(NS_SUCCEEDED(rv), "removing of account prefs failed");
return NS_OK;
}
nsresult
nsMsgAccountManager::OutputAccountsPref()
{
nsCString accountKey;
mAccountKeyList.Truncate();