harvester/server/src/reharvesterao.cpp
branchRCL_3
changeset 19 b73252188534
parent 9 82c0024438c8
child 20 f23c07ec56e2
--- a/harvester/server/src/reharvesterao.cpp	Thu Jul 15 19:07:24 2010 +0300
+++ b/harvester/server/src/reharvesterao.cpp	Thu Aug 19 10:20:41 2010 +0300
@@ -19,8 +19,8 @@
 #include "mdeobject.h"
 #include "mdsutils.h"
 
-const TInt KResumeTime = 2000000;  //microseconds
-const TInt KTimeIncrease = 500000; //microseconds
+const TInt KResumeTime = 3000000;  //microseconds
+const TInt KTimeIncrease = 1000000; //microseconds
 const TInt KTimeLimit = 30000000;    //microseconds
 
 // ---------------------------------------------------------------------------
@@ -165,6 +165,7 @@
             WRITELOG1("CReHarvesterAO::AddItem() - %S already exists in re-harvester queue", &aItem->Uri() );
 #endif
             delete aItem;
+            aItem = NULL;
             return;
             }
         }
@@ -173,11 +174,16 @@
     if( mdeObject )
     	{
     	delete mdeObject;
+    	mdeObject = NULL;
     	aItem->SetMdeObject( NULL );
     	}
     
-    iItems.Append( aItem );
-    
+    if(iItems.Append( aItem ) != KErrNone )
+        {
+        delete aItem;
+        aItem = NULL;
+        }
+
     iDelay = KResumeTime;
     const TTimeIntervalMicroSeconds32 delay = TTimeIntervalMicroSeconds32( iDelay );
     
@@ -206,6 +212,7 @@
         // found matching item
 	    iItems.Remove( i );
 	    delete item;
+	    item = NULL;
         }
     
     if ( iItems.Count() == 0 )