mds_plat/content_listing_framework_collection_manager_api/tsrc/src/CollectionManagerTestBlocks.cpp
branchRCL_3
changeset 26 9f21bab39f42
parent 0 c53acadfccc6
--- a/mds_plat/content_listing_framework_collection_manager_api/tsrc/src/CollectionManagerTestBlocks.cpp	Tue Apr 27 17:05:23 2010 +0300
+++ b/mds_plat/content_listing_framework_collection_manager_api/tsrc/src/CollectionManagerTestBlocks.cpp	Tue May 11 16:36:55 2010 +0300
@@ -471,6 +471,7 @@
     
     const TInt itemCount( 500 );
     CDesCArray* removeItemArray = new (ELeave) CDesCArrayFlat( itemCount );
+    CleanupStack::PushL( removeItemArray );
 
     for( TInt i = 0 ; i < itemCount ; ++i )
         {
@@ -484,12 +485,12 @@
     TRAP( error, iCollectionManager->RemoveFromAllCollectionsL( *removeItemArray ) );
     if( error != KErrNotSupported && error != KErrNone )
         {
-        delete removeItemArray;
+        CleanupStack::PopAndDestroy( removeItemArray );
         removeItemArray = NULL;
         return error;
         }
     
-    delete removeItemArray;
+    CleanupStack::PopAndDestroy( removeItemArray );
     removeItemArray = NULL;
     
     _LIT( KMsg2, "Exit RemoveFromAllCollectionsL" );