diff -r fbb813aef148 -r 7e4e4bcc75b6 email/pop3andsmtpmtm/clientmtms/src/cemailaccounts.cpp --- a/email/pop3andsmtpmtm/clientmtms/src/cemailaccounts.cpp Tue May 11 16:10:04 2010 +0300 +++ b/email/pop3andsmtpmtm/clientmtms/src/cemailaccounts.cpp Tue May 25 12:38:02 2010 +0300 @@ -809,6 +809,7 @@ */ EXPORT_C void CEmailAccounts::GetPopAccountsL(RArray& aAccounts) { + CleanupClosePushL( aAccounts ); aAccounts.Reset(); CRepository& popRepository = PopRepositoryL(); @@ -855,7 +856,8 @@ } } - CleanupStack::PopAndDestroy(3, &popAccountIds); + CleanupStack::PopAndDestroy(3, &popAccountIds); + CleanupStack::Pop(&aAccounts); // aAccounts } /** @@ -921,6 +923,7 @@ */ EXPORT_C void CEmailAccounts::GetImapAccountsL(RArray& aAccounts) { + CleanupClosePushL( aAccounts ); aAccounts.Reset(); CRepository& imapRepository = ImapRepositoryL(); @@ -967,7 +970,8 @@ } } - CleanupStack::PopAndDestroy(3, &imapAccountIds); + CleanupStack::PopAndDestroy(3, &imapAccountIds); + CleanupStack::Pop(&aAccounts); // aAccounts } void CEmailAccounts::GetEmailServicesL(CMsvEntrySelection& aServices, TUid aMTMType, CMsvEntry& aMsvEntry) @@ -1057,6 +1061,7 @@ */ EXPORT_C void CEmailAccounts::GetSmtpAccountsL(RArray& aAccounts) { + CleanupClosePushL( aAccounts ); aAccounts.Reset(); CRepository& smtpRepository = SmtpRepositoryL(); @@ -1103,7 +1108,8 @@ } } - CleanupStack::PopAndDestroy(3, &smtpAccountIds); + CleanupStack::PopAndDestroy(3, &smtpAccountIds); + CleanupStack::Pop(&aAccounts); // aAccounts } /** @@ -1116,6 +1122,7 @@ */ EXPORT_C void CEmailAccounts::GetSmtpMobilityAccountsL(const TSmtpAccount& aSmtpAccount, RArray& aAccounts) { + CleanupClosePushL( aAccounts ); aAccounts.Reset(); CRepository& repository = SmtpRepositoryL(); @@ -1150,6 +1157,8 @@ { User::Leave(err); } + + CleanupStack::Pop(&aAccounts); // aAccounts } /** @@ -1161,6 +1170,7 @@ */ EXPORT_C void CEmailAccounts::GetSmtpMobilityAccountsL(RArray& aAccounts) { + CleanupClosePushL( aAccounts ); aAccounts.Reset(); CRepository& repository = SmtpRepositoryL(); @@ -1190,6 +1200,7 @@ } CleanupStack::PopAndDestroy(&smtpAccountIds); + CleanupStack::Pop(&aAccounts); // aAccounts } /**