Beispiel #1
0
AccountManager::~AccountManager()
{
	Account* account = (Account*)(m_accountlist.First());
	Account* next_account;
	while (account)
	{
		next_account = (Account*)(account->Suc());
		account->Out();
		if (!m_m2_init_failed) //Only store accounts.ini if we know we didn't fail reading it!
		{
			account->SaveSettings(FALSE); // don't commit, it will happen below
		}
		OP_DELETE(account);
		account = next_account;
	}

	if (!m_m2_init_failed && m_headerdisplay)
	{
		m_headerdisplay->SaveSettings();
	}
	OP_DELETE(m_headerdisplay);

	if (!m_m2_init_failed) //Only store accounts.ini if we know we didn't fail reading it!
	{
		// write prefs file
		OpStatus::Ignore(CommitPrefsFile(TRUE)); //We need to get this on disk (not much we can do if Commit fails)
	}

    if (m_prefs_file)
		MessageEngine::GetInstance()->GetGlueFactory()->DeletePrefsFile(m_prefs_file); //If m_m2_init_failed, this will assert, even though everything is ok
}