harvester/server/src/reharvesterao.cpp
changeset 54 a3cc46f37772
parent 23 33ae025ac1e8
--- a/harvester/server/src/reharvesterao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/src/reharvesterao.cpp	Fri Sep 17 16:54:49 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,19 +165,19 @@
             WRITELOG1("CReHarvesterAO::AddItem() - %S already exists in re-harvester queue", &aItem->Uri() );
 #endif
             delete aItem;
+            aItem = NULL;
             return;
             }
         }
     
-    CMdEObject* mdeObject = &aItem->MdeObject();
-    if( mdeObject )
-    	{
-    	delete mdeObject;
-    	aItem->SetMdeObject( 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 +206,7 @@
         // found matching item
 	    iItems.Remove( i );
 	    delete item;
+	    item = NULL;
         }
     
     if ( iItems.Count() == 0 )