omads/omadsappui/AspSyncUtil/src/AspPreSyncPluginInterface.cpp
branchRCL_3
changeset 24 661c849b1858
parent 18 a564f66a2339
--- a/omads/omadsappui/AspSyncUtil/src/AspPreSyncPluginInterface.cpp	Tue Apr 27 16:23:46 2010 +0300
+++ b/omads/omadsappui/AspSyncUtil/src/AspPreSyncPluginInterface.cpp	Tue May 11 16:00:32 2010 +0300
@@ -105,7 +105,7 @@
     if (error != KErrNone)
         {
 		CleanupStack::PopAndDestroy( &infoArray );
-        return NULL;
+		User::Leave( error );
         }
     // Instantiate plugins for all impUIds by calling 
     // InstantiatePlugInFromImpUidL
@@ -122,6 +122,7 @@
 	        //instantiate plugin for impUid
 	        defaultSyncPlugin = InstantiatePlugInFromImpUidL( impUid );
 			defaultSyncPlugin->SetProfile(aProfileId);
+			break;
             }
 		else
 		    {
@@ -142,11 +143,7 @@
     CleanupStack::PopAndDestroy( &infoArray );
 	if(bHandleSync)
 	{		
-		//delete defaultSyncPlugin;
-	    if(defaultSyncPlugin != NULL)
-	    {
-	    delete defaultSyncPlugin;
-	    }
+		delete defaultSyncPlugin;
 	    CleanupStack::PushL(syncPlugin);
 		return syncPlugin;
 	}