phonebookengines/VirtualPhonebook/VPbkSimStore/src/CFindView.cpp
branchRCL_3
changeset 32 2828b4d142c0
parent 0 e686773b3f54
child 64 c1e8ba0c2b16
--- a/phonebookengines/VirtualPhonebook/VPbkSimStore/src/CFindView.cpp	Tue Apr 27 16:23:35 2010 +0300
+++ b/phonebookengines/VirtualPhonebook/VPbkSimStore/src/CFindView.cpp	Tue May 11 16:00:21 2010 +0300
@@ -183,6 +183,7 @@
 //
 void CFindView::MatchL( RPointerArray<MVPbkSimContact>& aMatchedContacts )
     {
+    CleanupResetAndDestroyPushL( aMatchedContacts );
     if (iAlwaysIncluded.Count() == 0)
         {
         // No always included contacts. The match can be done using
@@ -232,6 +233,7 @@
     
     // Free the memory
     iSIMMatchedContacts.Reset(); 
+    CleanupStack::Pop( &aMatchedContacts );
     }
         
 // --------------------------------------------------------------------------
@@ -307,6 +309,7 @@
         const MVPbkContactLink& /*aContactLink*/,
         RPointerArray<MVPbkSimContact>& aMatchedContacts )
     {
+    CleanupResetAndDestroyPushL( aMatchedContacts );
     if ( &iParentView == &aView )
         {
         const CViewContact& viewContact = static_cast<const CViewContact&>(
@@ -363,6 +366,7 @@
                 }
             }
         }
+    CleanupStack::Pop( &aMatchedContacts );
     }
 
 // --------------------------------------------------------------------------
@@ -407,6 +411,7 @@
 void CFindView::MatchContactL( const CViewContact& aViewContact,
             RPointerArray<MVPbkSimContact>& aMatchedContacts )
     {
+    CleanupResetAndDestroyPushL( aMatchedContacts );
     // aContact matches if it's one of the always included contacts OR
     // (if it's one of Contacts Model matched contacts AND it also
     // passes our own match).
@@ -445,6 +450,7 @@
             CleanupStack::Pop( cnt );
             }
         }
+    CleanupStack::Pop( &aMatchedContacts ); 
     }
 
 // --------------------------------------------------------------------------