syncmlfw/syncmlnotifier/src/SyncMLPreSyncPluginInterface.cpp
branchRCL_3
changeset 28 915074efc433
parent 21 504e41245867
--- a/syncmlfw/syncmlnotifier/src/SyncMLPreSyncPluginInterface.cpp	Tue Apr 27 17:31:13 2010 +0300
+++ b/syncmlfw/syncmlnotifier/src/SyncMLPreSyncPluginInterface.cpp	Tue May 11 16:59:53 2010 +0300
@@ -106,7 +106,7 @@
     if (error != KErrNone)
         {
 		CleanupStack::PopAndDestroy( &infoArray );
-        return NULL;
+		User::Leave( error );
         }
 
     // Instantiate plugins for all impUIds by calling 
@@ -123,7 +123,8 @@
         {			
 	        //instantiate plugin for impUid
 	        defaultSyncPlugin = InstantiatePlugInFromImpUidL( impUid );
-	        defaultSyncPlugin->SetProfile(aProfileId);
+			defaultSyncPlugin->SetProfile(aProfileId);
+			break;
         }
 		else
 		{
@@ -144,12 +145,9 @@
     CleanupStack::PopAndDestroy( &infoArray );
 	if(bHandleSync == true)
 	{		
-		//delete defaultSyncPlugin;
-	    if(defaultSyncPlugin != NULL)
-	    {
-	    delete defaultSyncPlugin;
-	    }
-	    CleanupStack::PushL(syncPlugin);
+		
+	     delete defaultSyncPlugin;
+		CleanupStack::PushL(syncPlugin);
 		return syncPlugin;
 	}
 	else