ipsservices/ipssosplugin/src/ipsplgcreatereplymessageoperation.cpp
changeset 76 38bf5461e270
parent 23 2dc6caa42ec3
equal deleted inserted replaced
74:6c59112cfd31 76:38bf5461e270
   137         // copy to recipients            
   137         // copy to recipients            
   138         TInt toRecipientCount( header->ToRecipients().Count() );
   138         TInt toRecipientCount( header->ToRecipients().Count() );
   139         for( TInt i = 0; i < toRecipientCount; i++ )
   139         for( TInt i = 0; i < toRecipientCount; i++ )
   140             {
   140             {
   141             emailAddr = header->ToRecipients()[i].AllocLC();
   141             emailAddr = header->ToRecipients()[i].AllocLC();
   142             fsAddr = CFSMailAddress::NewLC();
   142             fsAddr = CFSMailAddress::NewL();
   143             fsAddr->SetEmailAddress( *emailAddr ); // Copy created
   143             fsAddr->SetEmailAddress( *emailAddr ); // Copy created
   144             newMessage->AppendToRecipient( fsAddr ); // No copy
   144             newMessage->AppendToRecipient( fsAddr ); // No copy
   145             CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
       
   146             CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
   145             CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
   147             }
   146             }
   148 
   147 
   149         // get additional recipients (reply all case)
   148         // get additional recipients (reply all case)
   150         if( iPartList & KMsvMessagePartRecipient )
   149         if( iPartList & KMsvMessagePartRecipient )
   236                     present = ETrue;
   235                     present = ETrue;
   237                     break;
   236                     break;
   238                     }
   237                     }
   239                 }
   238                 }
   240            
   239            
       
   240             CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
   241             if( present )
   241             if( present )
   242                 {
   242                 {
   243                 aNewMessage->AppendToRecipient( fsAddr ); // No copy
   243                 aNewMessage->AppendToRecipient( fsAddr ); // No copy
   244                 }
   244                 }
   245             else
   245             else
   246                 {
   246                 {
   247                 aNewMessage->AppendCCRecipient( fsAddr ); // No copy
   247                 aNewMessage->AppendCCRecipient( fsAddr ); // No copy
   248                 }
   248                 }
   249            
   249            
   250             CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
       
   251             CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
   250             CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
   252             }
   251             }
   253         CleanupStack::PopAndDestroy( tmpHeader );
   252         CleanupStack::PopAndDestroy( tmpHeader );
   254         }
   253         }
   255     CleanupStack::PopAndDestroy( 2, tmpEntry );
   254     CleanupStack::PopAndDestroy( 2, tmpEntry );
   256    
   255    
   257     // copy bcc recipients
   256     // copy bcc recipients
   258     for( TInt i = 0; i < aHeader->BccRecipients().Count(); i++ )
   257     for( TInt i = 0; i < aHeader->BccRecipients().Count(); i++ )
   259         {
   258         {
   260         emailAddr = aHeader->BccRecipients()[i].AllocLC();
   259         emailAddr = aHeader->BccRecipients()[i].AllocLC();
   261         fsAddr = CFSMailAddress::NewLC();
   260         fsAddr = CFSMailAddress::NewL();
   262         fsAddr->SetEmailAddress( *emailAddr ); // Copy created
   261         fsAddr->SetEmailAddress( *emailAddr ); // Copy created
   263         aNewMessage->AppendBCCRecipient( fsAddr ); // No copy
   262         aNewMessage->AppendBCCRecipient( fsAddr ); // No copy
   264         CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
       
   265         CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
   263         CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
   266         }
   264         }
   267     }
   265     }
   268 //</qmail>
   266 //</qmail>
   269 //  End of File
   267 //  End of File