bearermanagement/mpm/src/mpmiapselection.cpp
branchRCL_3
changeset 15 4dc3bb0099b0
parent 13 68f0c7cd80ec
child 17 c14618f9de99
--- a/bearermanagement/mpm/src/mpmiapselection.cpp	Mon Mar 15 12:42:11 2010 +0200
+++ b/bearermanagement/mpm/src/mpmiapselection.cpp	Wed Mar 31 22:15:10 2010 +0300
@@ -724,9 +724,11 @@
            TExtendedConnPref::ENoteBehaviourConnDisableNotes ) )
         {
         TBool connectionAlreadyActive =
-            iSession->MyServer().CheckIfStarted( aPolicyPref->IapId() );
+            iSession->MyServer().CheckIfStarted( aPolicyPref->IapId(), 
+                                                 iSession->ConnectionId() );
         CConnectionUiUtilities* connUiUtils = NULL;
-        if ( !connectionAlreadyActive )
+        if ( !connectionAlreadyActive &&
+        	   ( iSession->IsMMSIap( aPolicyPref->IapId() ) == EFalse ) )
         	{
         	TRAPD( popupError,
           	     connUiUtils = CConnectionUiUtilities::NewL();
@@ -877,7 +879,13 @@
     delete iDialog;
     iDialog = NULL;
     
-    ImplicitConnectionL();
+    // Dialog is deleted. Letting a function leave here would panic the whole MPM.
+    //
+    TRAPD( err, ImplicitConnectionL() );
+    if( err != KErrNone )
+        {
+        ChooseIapComplete( err, &iChooseIapPref );
+        }
     }
     
 // -----------------------------------------------------------------------------