harvester/server/src/reharvesterao.cpp
branchRCL_3
changeset 63 e538444823de
parent 53 29d87345eaeb
--- a/harvester/server/src/reharvesterao.cpp	Wed Sep 15 12:40:59 2010 +0300
+++ b/harvester/server/src/reharvesterao.cpp	Wed Oct 13 15:02:02 2010 +0300
@@ -19,8 +19,8 @@
 #include "mdeobject.h"
 #include "mdsutils.h"
 
-const TInt KResumeTime = 3000000;  //microseconds
-const TInt KTimeIncrease = 1000000; //microseconds
+const TInt KResumeTime = 2000000;  //microseconds
+const TInt KTimeIncrease = 500000; //microseconds
 const TInt KTimeLimit = 30000000;    //microseconds
 
 // ---------------------------------------------------------------------------
@@ -165,19 +165,19 @@
             WRITELOG1("CReHarvesterAO::AddItem() - %S already exists in re-harvester queue", &aItem->Uri() );
 #endif
             delete aItem;
-            aItem = NULL;
             return;
             }
         }
     
-    aItem->SetMdeObject( NULL );
+    CMdEObject* mdeObject = &aItem->MdeObject();
+    if( mdeObject )
+    	{
+    	delete mdeObject;
+    	aItem->SetMdeObject( NULL );
+    	}
     
-    if(iItems.Append( aItem ) != KErrNone )
-        {
-        delete aItem;
-        aItem = NULL;
-        }
-
+    iItems.Append( aItem );
+    
     iDelay = KResumeTime;
     const TTimeIntervalMicroSeconds32 delay = TTimeIntervalMicroSeconds32( iDelay );
     
@@ -206,7 +206,6 @@
         // found matching item
 	    iItems.Remove( i );
 	    delete item;
-	    item = NULL;
         }
     
     if ( iItems.Count() == 0 )