filemanager/bkupengine/src/CMMCScBkupEngineImpl.cpp
branchRCL_3
changeset 13 5181328fad28
parent 0 6a9f87576119
--- a/filemanager/bkupengine/src/CMMCScBkupEngineImpl.cpp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/bkupengine/src/CMMCScBkupEngineImpl.cpp	Tue May 11 16:01:48 2010 +0300
@@ -1007,6 +1007,18 @@
     
     
 // ---------------------------------------------------------------------------
+// CMMCScBkupEngineImpl::ResetAndDestroyArchives
+// ---------------------------------------------------------------------------
+// 
+void CMMCScBkupEngineImpl::ResetAndDestroyArchives( TAny* aPtr )
+    {
+    RPointerArray< CMMCScBkupArchiveInfo >* archive = 
+        static_cast< RPointerArray< CMMCScBkupArchiveInfo >* >( aPtr );
+    archive->ResetAndDestroy();
+    archive->Close();
+    }
+
+// ---------------------------------------------------------------------------
 // CMMCScBkupEngineImpl::ListArchivesL()
 // 
 // Provide a list of valid (both content and category do match) archives 
@@ -1020,6 +1032,9 @@
     {
     __LOG("CMMCScBkupEngineImpl::ListArchivesL() - START");
 
+    TCleanupItem cleanupItem( ResetAndDestroyArchives, &aArchives );
+    CleanupStack::PushL( cleanupItem );
+    
     for(TInt i = 0; i < KMaxDrives; i++)
         {
         // Check is drive number allowed
@@ -1097,7 +1112,7 @@
             
         CleanupStack::PopAndDestroy(pFiles);
         }
-
+    CleanupStack::Pop( &aArchives );
     __LOG("CMMCScBkupEngineImpl::ListArchivesL() - END");
     }