syncmlfw/dm/syncagent/src/nsmldmagent.cpp
branchRCL_3
changeset 19 86979fe66c4c
parent 14 9e9792ae22e3
child 61 b183ec05bd8c
--- a/syncmlfw/dm/syncagent/src/nsmldmagent.cpp	Mon Mar 15 12:43:15 2010 +0200
+++ b/syncmlfw/dm/syncagent/src/nsmldmagent.cpp	Wed Mar 31 23:00:03 2010 +0300
@@ -1388,6 +1388,8 @@
 			      return;
 			    }
 			CleanupStack::PushL( profile );
+		  if( iError )
+		  {
            if(iError->SyncLogErrorCode() == KErrNone)
            {
            RWriteStream& LastSyncStream = profile->LastSyncWriteStreamL();
@@ -1413,6 +1415,7 @@
 	        CleanupStack::PopAndDestroy();	
 			}
           } 
+        }
 			CNSmlHistoryArray* array = CNSmlHistoryArray::NewL();
 			CleanupStack::PushL( array );
 			array->SetOwnerShip( ETrue );
@@ -1835,15 +1838,16 @@
 
         for(TInt i =0; i< count ; i++)
             {    
-            CNSmlDMAlertItem* iItem = new (ELeave) CNSmlDMAlertItem ;
-            iItem->iSource = ((*aItemList)[i].iSource)->AllocL();
-            iItem->iTarget = ((*aItemList)[i].iTarget)->AllocL();
-            iItem->iMetaType = ((*aItemList)[i].iMetaType)->AllocL();
-            iItem->iMetaFormat = ((*aItemList)[i].iMetaFormat)->AllocL();
-            iItem->iMetaMark = ((*aItemList)[i].iMetaMark)->AllocL();
-            iItem->iData = ((*aItemList)[i].iData)->AllocL();
-            iDataItem->AppendL(*iItem);
-            delete iItem;
+            CNSmlDMAlertItem* tempItem = new (ELeave) CNSmlDMAlertItem ;
+            CleanupStack::PushL( tempItem );
+            tempItem->iSource = ((*aItemList)[i].iSource)->AllocL();
+            tempItem->iTarget = ((*aItemList)[i].iTarget)->AllocL();
+            tempItem->iMetaType = ((*aItemList)[i].iMetaType)->AllocL();
+            tempItem->iMetaFormat = ((*aItemList)[i].iMetaFormat)->AllocL();
+            tempItem->iMetaMark = ((*aItemList)[i].iMetaMark)->AllocL();
+            tempItem->iData = ((*aItemList)[i].iData)->AllocL();
+            iDataItem->AppendL(*tempItem);
+            CleanupStack::PopAndDestroy( tempItem );
             }
         }