diff -r 10eaf342f539 -r 00c7ae862740 emailservices/emailcommon/src/CFSMailMessagePart.cpp --- a/emailservices/emailcommon/src/CFSMailMessagePart.cpp Tue Jun 29 17:12:28 2010 +0300 +++ b/emailservices/emailcommon/src/CFSMailMessagePart.cpp Fri Jul 02 15:55:16 2010 +0300 @@ -529,16 +529,19 @@ if(plugin != NULL) { RPointerArray parts; - RArray partIds; - plugin->ChildPartsL(GetMailBoxId(),GetFolderId(),GetMessageId(),GetPartId(),parts); + CleanupResetAndDestroyPushL( parts ); + plugin->ChildPartsL(GetMailBoxId(),GetFolderId(),GetMessageId(),GetPartId(),parts); + RArray partIds; + CleanupClosePushL( partIds ); + partIds.ReserveL( 1 + parts.Count() ); for(TInt i=0;iGetMessageId()); + partIds.AppendL( parts[i]->GetMessageId() ); } - partIds.Append(GetPartId()); + partIds.AppendL( GetPartId() ); plugin->RemovePartContentL(GetMailBoxId(), GetFolderId(), GetMessageId(), partIds); - parts.ResetAndDestroy(); - partIds.Reset(); + CleanupStack::PopAndDestroy( &partIds ); + CleanupStack::PopAndDestroy( &parts ); } } @@ -559,12 +562,12 @@ { // get attachment list RPointerArray attachments; - attachments.Reset(); + CleanupResetAndDestroyPushL( attachments ); DoAttachmentListL(attachments); // copy attachment part ids RArray ids; - ids.Reset(); + CleanupClosePushL( ids ); for(TInt i=0;iGetPartId()); @@ -577,8 +580,8 @@ } // clean tables - attachments.ResetAndDestroy(); - ids.Reset(); + CleanupStack::PopAndDestroy( &ids ); + CleanupStack::PopAndDestroy( &attachments ); } }