locationmanager/locationtrail/src/locationremappingao.cpp
changeset 40 910a23996aa0
parent 36 aa5a574040a4
--- a/locationmanager/locationtrail/src/locationremappingao.cpp	Wed Jul 14 07:57:22 2010 +0300
+++ b/locationmanager/locationtrail/src/locationremappingao.cpp	Fri Jul 23 10:03:59 2010 +0300
@@ -385,12 +385,14 @@
 		relation = iMdEClient->GetRelationL( iRemapItems[i].iRelationId );
 		
 		if(relation)
-		    {   
+		    {
+		    CleanupStack::PushL(relation);
             TTime timestamp( 0 );
             timestamp.UniversalTime();
             relation->SetLastModifiedDate( timestamp );
     	
             iMdEClient->UpdateRelationL( *relation );
+		    CleanupStack::PopAndDestroy(relation);
 		    }
 		}
 	
@@ -460,14 +462,16 @@
 						iRemapItems[i].iObjectId, aLocationId, 0 );
 				iMdEClient->AddRelationL( *relationObject );
 				CleanupStack::PopAndDestroy( relationObject );
-				LOG("CLocationRemappingAO::UpdateRelationsL - new relation created");
+				LOG("new relation created");
 				}
 			else
 				{
 				CMdERelation* relationObject = iMdEClient->GetRelationL( iRemapItems[i].iRelationId );
+                CleanupStack::PushL(relationObject);
 				relationObject->SetRightObjectIdL( aLocationId );
 				iMdEClient->UpdateRelationL( *relationObject );
-				LOG("CLocationRemappingAO::UpdateRelationsL - old relation updated");
+                CleanupStack::PopAndDestroy(relationObject);
+				LOG("old relation updated");
 				}
 			iRemapItems.Remove( i );
 			}